3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { public function method() { } } $obj = new Test; $ref = new ReflectionMethod($obj, 'method'); $closure = $ref->getClosure($obj;) echo "Starting loop..."; $start = microtime(true); for ($i=0; $i<1e6; $i++) { $closure(array()); } echo "Took ", number_format((microtime(true)-$start)*1e3, 3), " ms";
Output for 5.3.23, 5.4.13
Parse error: syntax error, unexpected ';' in /in/B7g6u on line 9
Process exited with code 255.
Output for 5.3.0 - 5.3.22, 5.4.0 - 5.4.12
Parse error: syntax error, unexpected ';' in ABZBu on line 9
Process exited with code 255.

preferences:
173.03 ms | 1395 KiB | 45 Q