This is with reference to Get a static property of an instance, I am a newbie and have the following code :
class Foo
{
public static $my_static = 1;
}
class Bar extends Foo
{
}
$foo = new Foo();
$boo = new Bar();
echo Foo::$my_static; // ok
echo Bar::$my_static; // ok
echo $foo::$my_static; // ok
echo $boo::$my_static; // ok
Static variables/properties are accessed only as ClassName::static_property as in C++, but it is not the case in PHP... but PHP books mostly mention the className::static_property pattern, not the object::static_property construct. Need more light on this..