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 isset: ", 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 in_array: ", 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.3.120.0100.15615.89
7.3.110.0050.18715.93
7.3.100.0030.14215.89
7.3.90.0080.16016.10
7.3.80.0070.14915.91
7.3.70.0050.15215.92
7.3.60.0100.12915.86
7.3.50.0070.14115.81
7.3.40.0070.12415.76
7.3.30.0070.12815.88
7.3.20.0070.12816.82
7.3.10.0030.14616.59
7.3.00.0060.15616.68
7.2.240.0070.13815.98
7.2.230.0050.13716.28
7.2.220.0100.14916.04
7.2.210.0050.15616.05
7.2.200.0070.14715.83
7.2.190.0050.13815.92
7.2.180.0050.14615.92
7.2.170.0030.15616.08
7.2.160.0000.12815.91
7.2.150.0030.13716.96
7.2.140.0070.13216.99
7.2.130.0020.16216.98
7.2.120.0040.15616.95
7.2.110.0040.15016.90
7.2.100.0030.14316.98
7.2.90.0040.14516.90
7.2.80.0070.13416.92
7.2.70.0040.13217.05
7.2.60.0090.13117.06
7.2.50.0060.13517.02
7.2.40.0050.13016.94
7.2.30.0020.12916.95
7.2.20.0070.13416.97
7.2.10.0080.12616.96
7.2.00.0070.12717.65
7.1.330.0020.17515.80
7.1.320.0070.15815.66
7.1.310.0050.14715.87
7.1.300.0030.13415.76
7.1.290.0070.14815.66
7.1.280.0020.13115.77
7.1.270.0030.15315.88
7.1.260.0030.15915.79
7.1.250.0030.16515.75
7.1.70.0030.13317.26
7.1.60.0030.13817.09
7.1.50.0030.13817.03
7.1.40.0030.13516.57
7.1.30.0030.13416.57
7.1.20.0100.13216.74
7.1.10.0030.19416.88
7.1.00.0030.19016.72
7.0.200.0030.13016.86
7.0.190.0070.17516.64
7.0.180.0000.14016.39
7.0.170.0000.12816.22
7.0.160.0070.14016.22
7.0.150.0000.13016.30
7.0.140.0000.13816.32
7.0.130.0000.15016.64
7.0.120.0030.16916.76
7.0.110.0000.13816.39
7.0.100.0030.14516.21
7.0.90.0030.13616.44
7.0.80.0000.14816.46
7.0.70.0030.13216.31
7.0.60.0030.13416.17
7.0.50.0000.12616.46
7.0.40.0100.14015.31
7.0.30.0000.13715.31
7.0.20.0030.12215.31
7.0.10.0000.12915.31
7.0.00.0000.12815.31
5.6.300.0071.13522.26
5.6.290.0031.14421.88
5.6.280.1041.22222.36
5.6.270.0031.30522.18
5.6.260.0101.20722.34
5.6.250.0101.24722.20
5.6.240.0031.29922.35
5.6.230.3131.18122.26
5.6.220.2261.23522.26
5.6.210.0071.46622.28
5.6.200.0101.23922.23
5.6.190.0031.19022.17
5.6.180.1731.21722.18
5.6.170.0071.20022.23
5.6.160.0071.14622.23
5.6.150.0101.26122.33
5.6.140.0031.11822.35
5.6.130.0031.09722.23
5.6.120.0031.17222.33
5.6.110.0031.19622.15
5.6.100.0001.22222.27
5.6.90.0001.45522.31
5.6.80.1401.23421.46
5.6.70.0101.18921.71
5.6.60.0931.26221.53
5.6.50.0001.15021.63
5.6.40.0071.17621.53
5.6.30.0071.13121.69
5.6.20.0031.15221.69
5.6.10.0931.22421.48
5.6.00.0001.14221.68
5.5.380.0031.23218.64
5.5.370.0071.17918.75
5.5.360.0531.18418.80
5.5.350.0031.15218.86
5.5.340.0101.48519.29
5.5.330.0031.45119.25
5.5.320.0001.48219.17
5.5.310.0071.48219.12
5.5.300.0071.55319.29
5.5.290.0031.44519.33
5.5.280.2901.37419.18
5.5.270.0001.44919.11
5.5.260.0031.43519.11
5.5.250.0001.56019.02
5.5.240.0031.53918.51
5.5.230.0031.47818.72
5.5.220.0031.46418.33
5.5.210.0071.39618.69
5.5.200.0001.40918.52
5.5.190.0001.50118.68
5.5.180.0001.42418.52
5.5.160.0001.44518.59
5.5.150.0071.42518.63
5.5.140.0031.41918.55
5.5.130.0031.47818.64
5.5.120.0001.46218.65
5.5.110.0031.47518.30
5.5.100.0001.45918.24
5.5.90.0031.59618.59
5.5.80.0001.48418.20
5.5.70.0001.50318.36
5.5.60.0031.55518.54
5.5.50.0001.45018.55
5.5.40.0071.52018.36
5.5.30.0001.48218.22
5.5.20.0071.49318.49
5.5.10.0001.56118.22
5.5.00.0071.41518.48
5.4.450.0001.40720.62
5.4.440.0031.38820.61
5.4.430.0101.42220.42
5.4.420.0071.48620.70
5.4.410.0101.43620.42
5.4.400.0031.41220.32
5.4.390.0031.37020.03
5.4.380.0131.41920.18
5.4.370.0031.38320.20
5.4.360.0031.44520.02
5.4.350.0131.44620.32
5.4.340.0071.43720.30
5.4.320.0031.32820.37
5.4.310.0101.32620.35
5.4.300.0031.39220.32
5.4.290.0001.36020.04
5.4.280.0201.46420.11
5.4.270.0101.41220.21
5.4.260.0071.34520.21
5.4.250.0001.45420.02
5.4.240.0001.45120.19
5.4.230.0001.34920.36
5.4.220.0471.40420.27
5.4.210.0031.45920.36
5.4.200.0101.34620.14
5.4.190.0031.42220.30
5.4.180.0071.39020.27
5.4.170.0031.36020.29
5.4.160.0071.43720.38
5.4.150.0001.36720.19
5.4.140.0031.49417.89
5.4.130.1001.41717.56
5.4.120.0031.41817.61
5.4.110.0101.39117.93
5.4.100.0031.40117.85
5.4.90.0071.41617.89
5.4.80.0031.41317.79
5.4.70.0071.47117.55
5.4.60.0271.41117.90
5.4.50.0831.38717.87
5.4.40.0001.42117.83
5.4.30.0031.37517.55
5.4.20.0031.38717.76
5.4.10.0031.37617.95
5.4.00.0031.38917.18

preferences:
34.25 ms | 401 KiB | 5 Q