3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class MyClass { public $prop1 = "I'm a class property!"; public function get() { $a = $this->prop1; $f = function () { return $a; } return $f(); } } $obj = new MyClass; echo $obj->get();
Output for 5.4.0 - 5.4.21
Parse error: syntax error, unexpected 'return' (T_RETURN) in /in/DIMUE on line 16
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_RETURN in /in/DIMUE on line 16
Process exited with code 255.