Tuesday 29 of July 2003 11:13, Zurab Davitiani wrote in comp.lang.php:
the property; if so, you need to create an instance of the object. And, in
that case, don't define those methods and properties as static.
You don't need to create an instance of an object ... the following works
for me (tested right now ;):
<?php
class Test {
static $testingval;
public static function setVal($val){
test::$testingval += $val;
echo "val: " . test::$testingval . "<BR>";
}
}
test::setVal(1);
test::setVal(4);
test::setVal(8);
?>
with results:
val: 1
val: 5
val: 13
on `official` PHP5b1
regards!
-robert-
--
Robert Jirik
[mailto:robert(at)aristoteles(dot)xhaven(dot)net]
public PGP key:
http://xhaven.net/robert/pgp_key.asc
-
"In the first place, God made idiots. That was for practice.
Then he made school boards"
-- Mark Twain