3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Model { private $id; public function setId($id) { $this->id = $id; } } $time = microtime(true); for ($i = 0; $i < 500000; $i++) { $model = new Model; $method = 'setId'; call_user_func_array(array($model, $method), array('test')); } $time = microtime(true) - $time; echo 'call user func took ' . number_format($time, 3) . ' seconds\n";
Output for 5.4.0 - 5.4.17
Parse error: syntax error, unexpected '' seconds\n";' (T_ENCAPSED_AND_WHITESPACE) in /in/GiIXV on line 22
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE in /in/GiIXV on line 22
Process exited with code 255.

preferences:
175.06 ms | 1395 KiB | 53 Q