Assume the following:
class a {
public static $foo = 'bar';
}
class b {
public $classname = 'a';
}
$b = new b();
Somehow (braces, etc.), you can directly access $ foo without creating an "unexpected :: (T_PAAMAYIM_NEKUDOTAYIM)":
$b->classname::$foo //should result in "bar" not in an "unexpected :: (T_PAAMAYIM_NEKUDOTAYIM)"
I know and am using the following workaround:
$c = $b->classname;
$c::$foo;
but I would like to know if he has another good way to directly access $ foo.
source
share