3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = microtime(true); while (microtime(true) != $start + 1); // Wait a second to start up $loops = 10; $avg = 0; for ($i = 0; $i < $loops; $i++) { $start = microtime(true); for ($c = 0; $c < 1000; $c++) { // the 1000 may vary depending on the function theFunction(); } $end = microtime(true); echo "Take $i: " . ($end-$start) . "s\n"; $avg *= $i; $avg += $end - $start; $avg /= $i + 1; } echo "Average: " . $avg . "s\n";
Output for 7.0.0 - 7.0.31, 7.1.0 - 7.1.23, 7.2.0 - 7.2.11
Fatal error: Uncaught Error: Call to undefined function theFunction() in /in/1iiEY:10 Stack trace: #0 {main} thrown in /in/1iiEY on line 10
Process exited with code 255.
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.38
Fatal error: Call to undefined function theFunction() in /in/1iiEY on line 10
Process exited with code 255.

preferences:
117.92 ms | 402 KiB | 197 Q