3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Initial Configuration global $aHash; $i = 0; $tmp = ''; while($i < 10000) { $tmp .= 'a'; ++$i; } $aHash = array_fill(100000000000000000000000, 100, $tmp); unset($i, $tmp); // Test Source function Test1_9() { global $aHash; /* The Test */ $t = microtime(true); reset($aHash); $key = array_keys($aHash); $size = sizeOf($key); for ($i=0; $i<$size; $i++) $tmp[] = $aHash[$key[$i]]; return (microtime(true) - $t); } // Variable Clean-up function Test1_End() { global $aHash; unset($aHash); } ?>

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.0000.01519.57
7.1.70.0000.00917.29
7.1.60.0060.00617.35
7.1.50.0100.01016.99
7.1.00.0030.07722.36
7.0.200.0040.00816.57
7.0.140.0100.06722.00
7.0.60.0100.08019.93
7.0.50.0070.08017.85
7.0.40.0100.05720.20
7.0.30.0200.04020.24
7.0.20.0370.05020.23
7.0.10.0300.06020.35
7.0.00.0070.04720.06
5.6.280.0030.07321.26
5.6.210.0100.03320.82
5.6.200.0070.05318.31
5.6.190.0100.07020.56
5.6.180.3670.04320.64
5.6.170.0170.04020.63
5.6.160.0030.06320.51
5.6.150.0130.03018.22
5.6.140.0130.07018.21
5.6.130.0100.06318.27
5.6.120.0030.07021.10
5.6.110.0200.06321.14
5.6.100.0000.05021.18
5.6.90.0130.07721.10
5.6.80.0130.03320.50
5.6.70.4330.04020.58
5.5.350.0170.08020.42
5.5.340.0100.04018.05
5.5.330.0030.04720.40
5.5.320.0370.07320.48
5.5.310.0230.08020.39
5.5.300.0070.06318.07
5.5.290.0100.06318.03
5.5.280.0170.07320.98
5.5.270.0000.04321.01
5.5.260.0030.05720.87
5.5.250.0070.08720.73
5.5.240.0130.07720.33
5.4.450.1400.03019.31
5.4.440.0570.06719.56
5.4.430.0670.05319.31
5.4.420.0670.00019.62
5.4.410.0670.00019.31
5.4.400.0630.00019.08
5.4.390.0630.00019.11
5.4.380.0630.00019.09
5.4.370.0630.00019.12
5.4.360.0600.00019.16
5.4.350.0830.00019.25
5.4.340.0060.04612.04
5.4.320.0040.03912.52
5.4.310.0060.03812.52
5.4.300.0040.03912.52
5.4.290.0030.04212.52
5.4.280.0050.03612.42
5.4.270.0060.03612.41
5.4.260.0050.03912.42
5.4.250.0060.03812.42
5.4.240.0060.03612.41
5.4.230.0020.04112.41
5.4.220.0060.04412.41
5.4.210.0060.04012.41
5.4.200.0090.03912.41
5.4.190.0060.03712.41
5.4.180.0030.04212.40
5.4.170.0070.03512.41
5.4.160.0060.04212.41
5.4.150.0100.04112.41
5.4.140.0060.04312.09
5.4.130.0050.04112.08
5.4.120.0090.05012.04
5.4.110.0050.03712.03
5.4.100.0060.04012.03
5.4.90.0060.03612.03
5.4.80.0070.04112.04
5.4.70.0070.03412.03
5.4.60.0030.03712.03
5.4.50.0090.03212.03
5.4.40.0030.03712.02
5.4.30.0040.03712.02
5.4.20.0060.03512.02
5.4.10.0100.03012.01
5.4.00.0060.03511.51
5.3.290.0060.03912.80
5.3.280.0070.03712.71
5.3.270.0040.04212.72
5.3.260.0040.04012.72
5.3.250.0050.03812.72
5.3.240.0060.03712.72
5.3.230.0040.03912.71
5.3.220.0090.04512.68
5.3.210.0040.04012.68
5.3.200.0050.03712.68
5.3.190.0070.03712.68
5.3.180.0140.03812.68
5.3.170.0010.04712.66
5.3.160.0100.03712.68
5.3.150.0060.03912.67
5.3.140.0060.04112.66
5.3.130.0090.04612.66
5.3.120.0040.04112.66
5.3.110.0070.03812.66
5.3.100.0080.03512.14
5.3.90.0070.03512.13
5.3.80.0050.03612.11
5.3.70.0050.03912.11
5.3.60.0040.04312.10
5.3.50.0090.03312.05
5.3.40.0060.03812.04
5.3.30.0060.04112.01
5.3.20.0070.03411.79
5.3.10.0030.03711.75
5.3.00.0050.03711.74
5.2.170.0070.0319.24
5.2.160.0090.0339.24
5.2.150.0050.0319.24
5.2.140.0040.0329.23
5.2.130.0060.0289.20
5.2.120.0040.0379.20
5.2.110.0040.0309.21
5.2.100.0030.0329.20
5.2.90.0070.0359.20
5.2.80.0040.0369.20
5.2.70.0060.0339.20
5.2.60.0070.0379.15
5.2.50.0050.0299.13
5.2.40.0050.0299.10
5.2.30.0050.0299.07
5.2.20.0080.0369.06
5.2.10.0050.0288.96
5.2.00.0050.0298.83
5.1.60.0040.0258.11
5.1.50.0050.0248.11
5.1.40.0050.0248.09
5.1.30.0080.0268.44
5.1.20.0080.0238.46
5.1.10.0030.0278.19
5.1.00.0050.0258.19
5.0.50.0070.0186.67
5.0.40.0050.0276.52
5.0.30.0070.0306.34
5.0.20.0010.0236.33
5.0.10.0040.0256.30
5.0.00.0020.0336.30
4.4.90.0060.0194.78
4.4.80.0040.0164.75
4.4.70.0020.0184.75
4.4.60.0010.0194.75
4.4.50.0010.0184.77
4.4.40.0010.0294.71
4.4.30.0020.0194.76
4.4.20.0020.0184.84
4.4.10.0020.0184.85
4.4.00.0020.0314.76
4.3.110.0030.0184.67
4.3.100.0020.0184.66
4.3.90.0020.0174.63
4.3.80.0050.0314.59
4.3.70.0020.0174.63
4.3.60.0030.0234.63
4.3.50.0050.0154.63
4.3.40.0000.0284.55
4.3.30.0010.0193.36
4.3.20.0030.0173.33
4.3.10.0020.0173.29
4.3.00.0170.02012.38

preferences:
38.9 ms | 400 KiB | 5 Q