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.2.00.0030.18119.46
7.1.70.0470.12016.93
7.1.60.0030.21119.32
7.1.50.0030.19816.84
7.1.00.0070.25322.51
7.0.200.0030.15916.95
7.0.140.0170.21722.09
7.0.60.0170.22720.95
7.0.50.0030.16018.59
7.0.40.0000.20020.24
7.0.30.0300.24720.18
7.0.20.0270.24720.20
7.0.10.0100.21320.00
7.0.00.0030.21320.16
5.6.280.0131.13022.45
5.6.210.0131.48322.07
5.6.200.0101.47319.43
5.6.190.0101.52721.57
5.6.180.0131.38721.70
5.6.170.0201.41321.53
5.6.160.0171.49021.53
5.6.150.0031.55719.42
5.6.140.0131.50319.42
5.6.130.0101.48319.46
5.6.120.0031.44022.35
5.6.110.0031.42022.28
5.6.100.0031.46022.26
5.6.90.0131.47022.26
5.6.80.0071.38021.83
5.6.70.4631.31321.66
5.5.350.0201.40021.77
5.5.340.0101.45019.02
5.5.330.0031.42321.46
5.5.320.0331.46021.46
5.5.310.0301.45321.52
5.5.300.0071.44019.25
5.5.290.0001.38719.18
5.5.280.0001.63321.95
5.5.270.0171.44022.16
5.5.260.0071.47322.26
5.5.250.0071.50722.01
5.5.240.0131.29721.55
5.4.450.2301.34320.55
5.4.440.0101.35020.71
5.4.430.0231.39320.35
5.4.420.0201.45720.57
5.4.410.0171.31720.22
5.4.400.2701.31020.23
5.4.390.0271.31020.24
5.4.380.0271.41720.36
5.4.370.3031.35720.36
5.4.360.0171.39020.55
5.4.350.0201.39020.05
5.4.340.0101.32720.30
5.4.320.0301.37720.45
5.4.310.0201.39020.09
5.4.300.0131.41020.14
5.4.290.0271.38320.21
5.4.280.0231.41320.31
5.4.270.0201.42020.35
5.4.260.0131.38720.00
5.4.250.0171.39320.26
5.4.240.0231.43720.12
5.4.230.0171.38720.08
5.4.220.0101.33320.35
5.4.210.0171.53720.44
5.4.200.0171.38720.13
5.4.190.0231.47720.13
5.4.180.0171.31320.21
5.4.170.0101.39320.30
5.4.160.0171.49320.29
5.4.150.0301.40320.29
5.4.140.0331.41717.61
5.4.130.0301.37717.66
5.4.120.0131.42317.68
5.4.110.0231.35717.65
5.4.100.0231.46717.71
5.4.90.0171.35017.67
5.4.80.0271.37717.64
5.4.70.0201.37017.59
5.4.60.0101.31017.46
5.4.50.0271.43017.66
5.4.40.0171.46317.54
5.4.30.0201.34017.70
5.4.20.0131.33717.64
5.4.10.0101.46717.75
5.4.00.0171.33016.95
5.3.290.0171.41015.83
5.3.280.0231.55015.80
5.3.270.0171.36715.93
5.3.260.0231.53015.83
5.3.250.0201.40715.79
5.3.240.0231.41715.93
5.3.230.2601.39315.97
5.3.220.0171.41315.70
5.3.210.0271.48015.67
5.3.200.0301.43715.86
5.3.190.0171.39015.73
5.3.180.0231.41015.76
5.3.170.0231.36715.76
5.3.160.0071.36715.88
5.3.150.2601.41015.89
5.3.140.0301.39015.66
5.3.130.0201.39315.69
5.3.120.0201.37715.70
5.3.110.0171.50715.83
5.3.100.0631.35715.33
5.3.90.0171.35015.16
5.3.80.0131.34015.18
5.3.70.0171.46315.13
5.3.60.0301.36015.16
5.3.50.0201.38715.16
5.3.40.0171.41015.11
5.3.30.0201.44314.99
5.3.20.0271.37014.86
5.3.10.0131.30714.72
5.3.00.0131.32014.73
5.2.170.0131.81312.13
5.2.160.0302.01712.41
5.2.150.0202.05012.29
5.2.140.0101.85712.18
5.2.130.0172.06012.14
5.2.120.0201.92012.24
5.2.110.0071.90712.23
5.2.100.0031.93312.14
5.2.90.0101.93312.36
5.2.80.0031.85012.36
5.2.70.0132.09312.06
5.2.60.0201.98312.18
5.2.50.0101.99312.27
5.2.40.0171.98012.49
5.2.30.0072.08012.00
5.2.20.0101.90711.99
5.2.10.0071.92011.99
5.2.00.0031.76711.91
5.1.60.0101.92311.76
5.1.50.0102.17711.93
5.1.40.0101.94011.84
5.1.30.4701.86712.09
5.1.20.0131.99312.18
5.1.10.0131.97311.85
5.1.00.0171.97712.13
5.0.50.0032.02310.40
5.0.40.0071.90310.23
5.0.30.0001.90310.07
5.0.20.0101.9079.96
5.0.10.0132.0379.98
5.0.00.0101.91710.00
4.4.90.0031.8637.90
4.4.80.0071.7837.90
4.4.70.0001.8177.90
4.4.60.0131.8337.90
4.4.50.0071.8777.90
4.4.40.0071.8437.90
4.4.30.0071.7877.90
4.4.20.0031.7437.90
4.4.10.0031.6907.90
4.4.00.0031.7637.90
4.3.110.0071.7707.90
4.3.100.0001.7337.90
4.3.90.0031.7577.90
4.3.80.0031.7707.90
4.3.70.0031.7807.90
4.3.60.0071.8637.90
4.3.50.0101.8637.90
4.3.40.0101.9707.90
4.3.30.0001.8007.90
4.3.20.0001.8407.90
4.3.10.0031.8437.90
4.3.00.0001.8437.90

preferences:
35.95 ms | 401 KiB | 5 Q