On 5/11/07, M.Sokolewicz <[EMAIL PROTECTED]> wrote:
statically:
Class Foo {
static $a = 1;
static function Bar() {
self::a++;
}
}
echo Foo:a;
>> 1
Foo::Bar(); // will probably throw a warning, not sure of that though
echo Foo:a;
>> 1 (no change)
I'm not sure I understand what you mean by this. This code works:
Class Foo {
static $a = 1;
static function Bar() {
self::$a++;
var_dump(self::$a);
}
static function Meh() {
self::$a='asdf';
var_dump(self::$a);
}
}
Foo::Bar();
Foo::Bar();
Foo::Bar();
Foo::Meh();
----- output ----
int 2
int 3
int 4
string 'asdf' (length=4)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php