3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { public $bar; public function bar() { echo 'Foo::bar'; } } $baz = new Foo(); $baz->bar = function() { echo 'baz::bar'; } $baz->bar();
Output for 5.4.0 - 5.4.27
Parse error: syntax error, unexpected '$baz' (T_VARIABLE) in /in/WUqJF on line 13
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_VARIABLE in /in/WUqJF on line 13
Process exited with code 255.