3v4l.org

run code in 300+ PHP versions simultaneously
<?php $timings = [ 109719.80500221252, 55000.132545, 800.15347683, ]; foreach($timings as $time) { echo 'Original time: ', $time, PHP_EOL; if ($time > 60000) { $mins = floor($time / 60000); $secs = round((($time % 60000) / 1000), 2); $time = $mins.' mins'; if ($secs !== 0) { $time .= ", $secs secs"; } } else if ($time > 1000) { $time = round(($time / 1000), 2).' secs'; } else { $time = round($time).'ms'; } echo 'Human readable time: ', $time, PHP_EOL, PHP_EOL; }
Output for 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.4, 8.3.6 - 8.3.27, 8.4.1 - 8.4.14
Original time: 109719.80500221 Deprecated: Implicit conversion from float 109719.80500221252 to int loses precision in /in/r3DZZ on line 13 Human readable time: 1 mins, 49.72 secs Original time: 55000.132545 Human readable time: 55 secs Original time: 800.15347683 Human readable time: 800ms
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Original time: 109719.80500221 Deprecated: Implicit conversion from float 109719.80500221252 to int loses precision in /in/r3DZZ on line 13 Human readable time: 1 mins, 49.72 secs Original time: 55000.132545 Human readable time: 55 secs Original time: 800.15347683 Human readable time: 800ms
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30
Original time: 109719.80500221 Human readable time: 1 mins, 49.72 secs Original time: 55000.132545 Human readable time: 55 secs Original time: 800.15347683 Human readable time: 800ms

preferences:
160.4 ms | 410 KiB | 5 Q