3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tstart = microtime(true); $numberOfRandoms = 500; $uniques = array(); for($i = 0; $i < $numberOfRandoms; $i++) { do { $code = mt_rand(10000,99999); } while(in_array($code, $uniques); $uniques[] = $code; } $elapsed = microtime(true) - $tstart; echo $elapsed . PHP_EOL; $tstart = microtime(true); $numberOfRandoms = 500; $uniques = array(); do { $uniques[mt_rand(10000, 99999)] = true; } while(count(array_keys($uniques)) < $numberOfRandoms); $uniques = array_keys($uniques); $elapsed = microtime(true) - $tstart; echo $elapsed . PHP_EOL; $tstart = microtime(true); $uniques = range(10000, 99999); shuffle($uniques); $uniques = array_slice($uniques, 0, 500); $elapsed = microtime(true) - $tstart; echo $elapsed . PHP_EOL;

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
5.4.280.0110.05012.37
5.4.270.0130.04212.37
5.4.260.0110.05412.37
5.4.250.0080.05012.37
5.4.240.0130.04912.36
5.4.230.0100.04812.36
5.4.220.0110.04812.36
5.4.210.0140.04212.36
5.4.200.0090.05212.36
5.4.190.0110.04312.35
5.4.180.0070.05912.36
5.4.170.0140.05012.36
5.4.160.0100.05412.36
5.4.150.0080.04912.35
5.4.140.0120.05312.05
5.4.130.0140.04412.03
5.4.120.0100.04911.99
5.4.110.0080.05711.98
5.4.100.0120.04511.98
5.4.90.0110.05411.98
5.4.80.0110.03611.99
5.4.70.0120.03311.98
5.4.60.0080.03711.98
5.4.50.0090.03711.98
5.4.40.0060.03811.97
5.4.30.0110.04711.96
5.4.20.0090.03611.96
5.4.10.0050.03611.96
5.4.00.0080.03511.46
5.3.280.0110.04512.71
5.3.270.0130.05212.71
5.3.260.0150.04612.72
5.3.250.0090.05512.72
5.3.240.0110.04812.72
5.3.230.0170.04212.71
5.3.220.0070.05712.68
5.3.210.0100.04712.68
5.3.200.0070.05212.68
5.3.190.0130.04512.68
5.3.180.0130.04812.67
5.3.170.0130.04312.67
5.3.160.0100.04912.67
5.3.150.0100.05612.67
5.3.140.0100.04512.66
5.3.130.0120.05312.66
5.3.120.0120.04812.66
5.3.110.0110.05212.66
5.3.100.0100.04612.12
5.3.90.0060.04712.09
5.3.80.0090.03512.07
5.3.70.0050.03912.08
5.3.60.0120.03312.06
5.3.50.0060.05112.00
5.3.40.0180.05012.00
5.3.30.0140.05011.94
5.3.20.0090.06011.71
5.3.10.0150.06911.67
5.3.00.0130.05311.66

preferences:
133.62 ms | 1394 KiB | 7 Q