3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo { public static function hello() { echo "Hello !"; } } class Bar { public $apple = null; public function __construct() { $this->apple = new Foo(); } } $foo = new Bar(); $baz = ((Foo)$foo->apple)::hello(); $baz::hello();
Output for 5.4.0 - 5.4.20
Parse error: syntax error, unexpected '$foo' (T_VARIABLE) in /in/HYS76 on line 20
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_VARIABLE in /in/HYS76 on line 20
Process exited with code 255.