3v4l.org

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