Código PHP:
class Foo
{
public static $my_static = 2;
public static function getVar() {
return self::$my_static;
}
public static function bar(){
Foo::$my_static +=55;
}
} # end class
Foo::bar();
echo Foo::getVar();
Código PHP:
class Foo
{
public static $my_static = 'foo';
public static function getVar() {
return self::$my_static;
}
public static function bar(){
Foo::$my_static +=' bar';
}
} # end class
Foo::bar();
echo Foo::getVar();
Como se explica eso ?