3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tests = 1000000; $max = 5000001; for( $i = 1; $i <= $max; $i += 10000 ) { //create lookup array $array = array_fill( 0, $i, NULL ); //build test indexes $test_indexes = array(); for( $j = 0; $j < $tests; $j++ ) { $test_indexes[] = rand( 0, $i-1 ); } //benchmark array lookups $start = microtime( TRUE ); foreach( $test_indexes as $test_index ) { $value = $array[ $test_index ]; unset( $value ); } $stop = microtime( TRUE ); unset( $array, $test_indexes, $test_index ); printf( "%d,%1.15f\n", $i, $stop - $start ); //time per 1mil lookups unset( $stop, $start ); }

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)
8.1.10.4331.57257.69
8.1.00.4261.57857.62
8.0.140.4581.54456.74
8.0.130.4641.53956.82
8.0.120.4441.55856.86
8.0.110.4161.58956.87
8.0.100.4521.55757.41
8.0.90.4561.54757.47
8.0.80.4481.55557.62
8.0.70.4431.56057.05
8.0.60.4441.55956.66
8.0.50.4251.58056.76
8.0.30.4511.55357.22
8.0.20.4511.55257.18
8.0.10.4581.55257.09
8.0.00.4781.52257.43
7.4.270.4401.57056.60
7.4.260.4021.60256.49
7.4.250.4201.58556.09
7.4.240.4581.54656.48
7.4.230.4591.54456.56
7.4.220.4251.58356.54
7.4.210.4411.56556.59
7.4.200.4111.59056.68
7.4.190.4431.55956.48
7.4.180.4351.56856.30
7.4.160.4171.58856.52
7.4.150.3941.60856.31
7.4.140.4081.59556.89
7.4.130.3931.60956.22
7.4.120.4151.58556.65
7.4.110.4251.58057.05
7.4.100.3991.60556.87
7.4.90.3951.61057.12
7.4.80.4501.55057.16
7.4.70.4101.59357.27
7.4.60.4461.55557.15
7.4.50.4321.57057.08
7.4.40.4031.60457.02
7.4.30.4311.57057.17
7.4.20.4311.57057.22
7.4.10.4481.55657.18
7.4.00.4491.55257.17
7.3.330.4341.56956.91
7.3.320.4471.55455.91
7.3.310.4321.57856.77
7.3.300.4191.58356.91
7.3.290.4121.59456.88
7.3.280.4201.58756.89
7.3.270.4081.60056.98
7.3.260.4271.57556.93
7.3.250.4151.58956.65
7.3.240.4521.55056.92
7.3.230.4461.55756.95
7.3.220.4201.58656.69
7.3.210.4351.56956.97
7.3.200.4231.58057.13
7.3.190.4141.58657.05
7.3.180.4331.57056.93
7.3.170.4141.59556.96
7.3.160.4181.58456.76
7.3.150.4811.52156.11
7.3.140.4461.55756.55
7.3.130.4651.53856.93
7.3.120.4331.57656.87
7.3.110.4471.55156.80
7.3.100.4621.54556.56
7.3.90.4481.55457.00
7.3.80.4051.59956.94
7.3.70.4371.56857.01
7.3.60.4171.58256.97
7.3.50.4161.58756.92
7.3.40.4351.56956.98
7.3.30.4381.56557.04
7.3.20.2531.75061.09
7.3.10.2001.80661.06
7.3.00.1811.82061.05
7.2.340.4181.58757.00
7.2.330.4211.57756.77
7.2.320.4001.60357.06
7.2.310.3941.60556.97
7.2.300.4001.60356.78
7.2.290.3911.61756.88
7.2.280.4001.60456.85
7.2.270.4221.58357.03
7.2.260.4311.56956.89
7.2.250.4401.56456.92
7.2.240.4381.56657.09
7.2.230.4461.56556.95
7.2.220.4311.57156.62
7.2.210.4271.58156.98
7.2.200.3981.60556.99
7.2.190.4511.55857.14
7.2.180.4081.59557.06
7.2.170.4301.57357.20
7.2.160.4591.54757.10
7.2.150.1701.83362.29
7.2.140.1561.84662.43
7.2.130.1601.84262.48
7.2.120.1831.82062.48
7.2.110.1911.80862.51
7.2.100.1521.85262.41
7.2.90.2081.79662.31
7.2.80.1471.85662.20
7.2.70.1591.84862.23
7.2.60.1421.86062.34
7.2.50.1851.81562.42
7.2.40.1651.83962.41
7.2.30.1691.82862.45
7.2.20.1761.82762.53
7.2.10.1651.83562.45
7.2.00.1981.80362.36
7.1.330.1411.85959.27
7.1.320.1301.87159.35
7.1.310.1431.86159.33
7.1.300.1071.89659.43
7.1.290.1421.86459.34
7.1.280.1181.88759.31
7.1.270.1411.86159.34
7.1.260.1371.86959.27
7.1.250.1281.87459.20
7.1.240.1381.86359.28
7.1.230.1651.82758.25
7.1.220.1211.88559.32
7.1.210.1351.86559.32
7.1.200.1091.89359.20
7.1.190.1051.90059.16
7.1.180.1231.88059.35
7.1.170.1391.86259.15
7.1.160.1421.86659.22
7.1.150.1151.88759.05
7.1.140.1421.86259.23
7.1.130.1301.87459.20
7.1.120.1421.86359.29
7.1.110.1791.81858.17
7.1.100.1371.86359.29
7.1.90.1151.88559.18
7.1.80.1381.86459.35
7.1.70.3071.86158.41
7.1.60.5701.59758.71
7.1.50.1242.04359.80
7.1.40.1561.84059.36
7.1.30.1301.87359.43
7.1.20.1221.87959.31
7.1.10.1341.86359.23
7.1.00.1142.05560.89
7.0.330.1131.88558.98
7.0.320.1131.89258.94
7.0.310.1251.87858.99
7.0.300.1301.87159.15
7.0.290.1061.89758.95
7.0.280.1111.88758.96
7.0.270.1181.88059.08
7.0.260.1401.85958.93
7.0.250.1201.88259.19
7.0.240.1181.88359.20
7.0.230.1231.87459.08
7.0.220.1081.89259.08
7.0.210.1251.87759.08
7.0.200.1232.04359.60
7.0.190.1231.87759.13
7.0.180.1401.86459.10
7.0.170.1191.88059.11
7.0.160.1161.88758.93
7.0.150.1161.88159.02
7.0.140.0962.07261.31
7.0.130.1131.88859.11
7.0.120.1232.04561.45
7.0.110.1231.88459.00
7.0.100.1081.89758.06
7.0.90.1191.87758.03
7.0.80.1261.87758.90
7.0.70.1451.86059.03
7.0.60.1282.04261.35
7.0.50.1552.01061.26
7.0.40.1292.04158.62
7.0.30.1152.05459.39
7.0.20.1072.06259.43
7.0.10.1282.04160.10
7.0.00.1222.04560.08
5.6.400.0330.11780.50
5.6.390.0260.12780.37
5.6.380.0320.12680.39
5.6.370.0270.12080.41
5.6.360.0270.13080.44
5.6.350.0370.12580.42
5.6.340.0380.11380.57
5.6.330.0410.11580.40
5.6.320.0360.13380.43
5.6.310.0370.14380.37
5.6.300.0530.14680.35
5.6.290.0420.13480.42
5.6.280.0320.16082.14
5.6.270.0300.14680.36
5.6.260.0340.14280.41
5.6.250.0470.12880.53
5.6.240.0370.13880.54
5.6.230.0380.14280.51
5.6.220.0380.14580.66
5.6.210.0310.16482.10
5.6.200.0320.15882.33
5.6.190.0260.17082.39
5.6.180.0370.15882.31
5.6.170.0310.16382.32
5.6.160.0200.14382.29
5.6.150.0280.13382.37
5.6.140.0380.12582.31
5.6.130.0280.13282.36
5.6.120.0300.14782.29
5.6.110.0360.14182.34
5.6.100.0410.15182.19
5.6.90.0390.13882.14
5.6.80.0340.15181.97
5.6.70.0300.13681.91
5.6.60.0280.14881.88
5.6.50.0390.11982.02
5.6.40.0380.15482.08
5.6.30.0210.15581.98
5.6.20.0320.15282.04
5.6.10.0280.15881.95
5.6.00.0410.15281.94
5.5.380.0370.13980.67
5.5.370.0470.12980.74
5.5.360.0470.12880.44
5.5.350.0370.16281.97
5.5.340.0360.15182.17
5.5.330.0420.15782.11
5.5.320.0340.16782.15
5.5.310.0200.15682.09
5.5.300.0330.13582.12
5.5.290.0230.16682.16
5.5.280.0360.16582.07
5.5.270.0270.17082.17
5.5.260.0330.16382.13
5.5.250.0310.15082.21
5.5.240.0300.16782.00
5.5.230.0320.16381.88
5.5.220.0330.15081.96
5.5.210.0340.15782.04
5.5.200.0400.15681.80
5.5.190.0230.17281.72
5.5.180.0290.16682.00
5.5.170.0350.13080.39
5.5.160.0280.13781.85
5.5.150.0330.14381.87
5.5.140.0260.15681.81
5.5.130.0210.13981.88
5.5.120.0340.15181.80
5.5.110.0390.14081.74
5.5.100.0200.13681.98
5.5.90.0320.15881.87
5.5.80.0330.13981.86
5.5.70.0240.14681.78
5.5.60.0340.14881.92
5.5.50.0360.13081.92
5.5.40.0320.12981.96
5.5.30.0250.14781.93
5.5.20.0340.14181.76
5.5.10.0270.16781.95
5.5.00.0370.15781.94
5.4.450.0320.15579.46
5.4.440.0290.14879.50
5.4.430.0260.15079.40
5.4.420.0330.16479.56
5.4.410.0310.16579.42
5.4.400.0320.16579.38
5.4.390.0350.16579.36
5.4.380.0400.15579.35
5.4.370.0310.16579.38
5.4.360.0270.17279.34
5.4.350.0260.17279.26
5.4.340.0370.16279.39
5.4.330.0390.14877.19
5.4.320.0340.15379.37
5.4.310.0300.16479.29
5.4.300.0350.15379.38
5.4.290.0390.14979.33
5.4.280.0380.17279.38
5.4.270.0360.16579.37
5.4.260.0360.15079.18
5.4.250.0410.16579.18
5.4.240.0300.15479.24
5.4.230.0340.16279.19
5.4.220.0480.15979.15
5.4.210.0290.17979.18
5.4.200.0340.16279.12
5.4.190.0390.14879.12
5.4.180.0370.15979.08
5.4.170.0340.15679.15
5.4.160.0290.16479.22
5.4.150.0320.14179.10
5.4.140.0310.14578.47
5.4.130.0300.16278.44
5.4.120.0330.15078.49
5.4.110.0340.15178.38
5.4.100.0360.15378.44
5.4.90.0270.15478.45
5.4.80.0320.14878.52
5.4.70.0380.15078.54
5.4.60.0390.14378.49
5.4.50.0370.14578.41
5.4.40.0340.14178.44
5.4.30.0410.14078.45
5.4.20.0300.15778.56
5.4.10.0400.14578.39
5.4.00.0260.16778.12
5.3.290.0240.17676.64
5.3.280.0380.17076.54
5.3.270.0290.17276.66
5.3.260.0300.16076.61
5.3.250.0230.15076.57
5.3.240.0220.14776.59
5.3.230.0330.15476.67
5.3.220.0290.13976.56
5.3.210.0200.15776.61
5.3.200.0250.16276.47
5.3.190.0330.13576.65
5.3.180.0270.15976.64
5.3.170.0320.14876.74
5.3.160.0300.17576.57
5.3.150.0320.16676.57
5.3.140.0250.16576.57
5.3.130.0320.16276.55
5.3.120.0310.17676.65
5.3.110.0280.16376.61
5.3.100.0310.14876.52
5.3.90.0360.15276.38
5.3.80.0250.17176.28
5.3.70.0290.18276.15
5.3.60.0210.14676.49
5.3.50.0260.14776.22
5.3.40.0270.14576.12
5.3.30.0260.16376.35
5.3.20.0260.16676.17
5.3.10.0320.13976.13
5.3.00.0250.16776.05

preferences:
41.65 ms | 401 KiB | 5 Q