3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Foo { $a = 'b'; public function bar() { $fnc = function () { var_dump(isset($this)); var_dump(isset($this->a)); } $fnc(); } } $foo = new Foo(); $foo->bar();
Output for 5.4.0 - 5.4.17
Parse error: syntax error, unexpected '$a' (T_VARIABLE), expecting function (T_FUNCTION) in /in/tWdLT on line 4
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in /in/tWdLT on line 4
Process exited with code 255.