3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class A { const MY_CONST = 'This is my const'; } class B { private $property; public function __construct(A $a) { $this->property = $a; echo $a::MY_CONST."<br />"; // works (1) echo A::MY_CONST."<br />"; // works (2) $obj = $this->property; echo $obj::MY_CONST."<br />"; // works (3) echo {$this->property}::MY_CONST; // doesn't work (4) } }
Output for 5.3.0 - 5.4.28
Parse error: syntax error, unexpected '{' in /in/vbXXm on line 22
Process exited with code 255.