In PHP 5.3.6, I've noticed that the following won't work:
class Foo{
public static $class = 'Bar';
}
class Bar{
public static function sayHello(){
echo 'Hello World';
}
}
Foo::$class::sayHello();
Issuing an unexpected T_PAAMAYIM_NEKUDOTAYIM
. Using a temporary variable however, results in the expected:
$class = Foo::$class;
$class::sayHello(); // Hello World
Does anyone know if this is by design, or an unintended result of how the scope resolution operator is tokenized or something? Any cleaner workarounds than the latter, temporary variable example?