3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Runner { public run() { $result = $this->process(); $result(); } private process() { $runner = $this; return function() use ($runner) { $runner->do_run(); }; } private do_run() { echo __METHOD__, "\n"; } } $runner = new Runner(); $runner->run();
Output for 5.4.0 - 5.4.28
Parse error: syntax error, unexpected 'run' (T_STRING), expecting variable (T_VARIABLE) in /in/1ZHXT on line 3
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE in /in/1ZHXT on line 3
Process exited with code 255.