3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array(); for ($i = 0; $i < 10000; ++$i) { $v = rand(1, 1000000); $a[$v] = $v; } echo "Size: ", count($a), PHP_EOL; $start = microtime( true ); for ($i = 0; $i < 10000; ++$i) { isset($a[rand(1, 1000000)]); } $total_time = microtime( true ) - $start; echo "Total time: ", number_format($total_time, 6), PHP_EOL; $start = microtime( true ); for ($i = 0; $i < 10000; ++$i) { in_array(rand(1, 1000000), $a); } $total_time = microtime( true ) - $start; echo "Total time: ", number_format($total_time, 6), 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)
7.4.00.0030.19815.94
7.3.120.0100.23615.80
7.3.110.0030.16715.93
7.3.100.0070.14615.59
7.3.90.0070.13415.97
7.3.80.0030.12515.93
7.3.70.0030.11915.96
7.3.60.0030.14916.00
7.3.50.0030.14015.68
7.3.40.0030.12815.54
7.3.30.0100.13415.79
7.3.20.0030.13816.54
7.3.10.0030.13316.69
7.3.00.0100.12316.86
7.2.250.0070.23916.09
7.2.240.0070.15415.91
7.2.230.0070.12916.15
7.2.220.0030.12815.91
7.2.210.0030.12616.03
7.2.200.0130.12316.20
7.2.190.0030.12516.03
7.2.180.0100.14015.82
7.2.170.0000.12915.73
7.1.330.0030.16115.87
7.1.320.0070.13115.75
7.1.310.0070.17816.01
7.1.300.0030.13215.76
7.1.290.0000.15015.91
7.1.280.0000.15815.90
7.1.270.0000.16615.88
7.1.260.0000.15015.85
5.5.20.0141.53512.41
5.5.10.0091.36112.14
5.5.00.0161.29212.15
5.4.180.0101.40912.19
5.4.170.0131.58712.34
5.4.160.0061.38711.83
5.4.150.0161.47012.12
5.4.140.0191.44711.95
5.4.130.0101.45312.32
5.4.120.0101.39912.47
5.4.110.0161.55612.01
5.4.100.0101.42412.17
5.4.90.0161.37112.59
5.4.80.0101.35612.39
5.4.70.0191.64912.05
5.4.60.0271.68912.07
5.4.50.0091.45312.19
5.4.40.0001.29712.24
5.4.30.0131.32612.03
5.4.20.0061.35112.14
5.4.10.0061.57312.33
5.4.00.0151.37812.36
5.3.270.0101.85511.67
5.3.260.0191.78411.71
5.3.250.0101.77811.68
5.3.240.0061.66411.66
5.3.230.0031.74111.76
5.3.220.0101.72411.52
5.3.210.0031.64511.65
5.3.200.0031.69411.72
5.3.190.0161.74311.56
5.3.180.0101.88111.86
5.3.170.0361.98511.88
5.3.160.0122.10311.79
5.3.150.0071.77211.81
5.3.140.0031.80911.81
5.3.130.0061.72411.62
5.3.120.0161.86511.61
5.3.110.0061.66811.53
5.3.100.0152.07711.62
5.3.90.0162.05711.55
5.3.80.0101.72411.70
5.3.70.0061.84911.63
5.3.60.0061.73611.60
5.3.50.0071.77111.73
5.3.40.0071.64411.45
5.3.30.0001.68611.74
5.3.20.0071.68911.62
5.3.10.0161.71011.17
5.3.00.0061.74411.46

preferences:
32.01 ms | 401 KiB | 5 Q