3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Foreach with brackets $results = []; $aHash = []; $i = 0; $tmp = ''; while ($i < 10000) { $tmp .= 'a'; ++$i; } $aHash = array_fill(100000000000000000000000, 100, $tmp); unset($i, $tmp); /* The Test */ $t = microtime(true); foreach ($aHash as $key => $val) { $aHash[$key] .= "a"; } echo (microtime(true) - $t) * 1000000;

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.10.0060.01215.10
7.4.00.0120.00615.09
7.3.130.0000.01614.96
7.3.120.0070.01115.21
7.3.110.0130.00614.91
7.3.100.0160.00014.77
7.3.90.0100.00715.05
7.3.80.0060.00914.93
7.3.70.0030.00614.92
7.3.60.0070.01015.07
7.3.50.0100.00614.76
7.3.40.0110.00414.98
7.3.30.0040.01115.03
7.3.20.0070.01016.60
7.3.10.0060.00916.48
7.3.00.0040.01116.51
7.2.260.0060.01015.43
7.2.250.0120.00615.03
7.2.240.0000.01615.16
7.2.230.0030.01615.14
7.2.220.0030.01715.04
7.2.210.0060.00615.00
7.2.200.0040.01115.30
7.2.190.0110.00715.20
7.2.180.0000.01615.41
7.2.170.0110.00715.33
7.2.160.0000.01815.12
7.2.150.0040.01516.63
7.2.140.0100.00317.14
7.2.130.0070.00716.85
7.2.120.0040.01216.66
7.2.110.0030.00917.04
7.2.100.0030.00916.82
7.2.90.0060.00616.99
7.2.80.0000.01317.02
7.2.70.0060.00616.79
7.2.60.0060.01016.86
7.2.50.0110.00717.01
7.2.40.0030.01017.05
7.2.30.0100.00316.82
7.2.20.0030.01216.99
7.2.10.0030.01216.92
7.2.00.0070.00918.02
7.1.330.0000.01415.68
7.1.320.0090.00615.89
7.1.310.0090.00315.82
7.1.300.0000.01415.77
7.1.290.0030.01015.99
7.1.280.0000.00915.44
7.1.270.0100.00315.74
7.1.260.0030.00715.62
7.1.250.0000.01315.63
7.1.240.0030.00615.77
7.1.230.0070.00715.97
7.1.220.0040.01115.72
7.1.210.0000.01415.57
7.1.200.0090.00015.93
7.1.190.0110.00415.78
7.1.180.0000.00815.79
7.1.170.0120.00315.82
7.1.160.0090.00316.06
7.1.150.0000.02015.64
7.1.140.0030.01215.72
7.1.130.0030.01015.83
7.1.120.0090.00915.93
7.1.110.0080.00815.95
7.1.100.0030.01315.92
7.1.90.0050.00515.95
7.1.80.0060.00315.56
7.1.70.0020.01216.64
7.1.60.0060.01417.43
7.1.50.0080.00816.48
7.1.40.0060.01315.63
7.1.30.0060.00915.83
7.1.20.0000.01715.95
7.1.10.0030.00815.86
7.1.00.0050.04319.11
7.0.330.0060.00315.45
7.0.320.0060.00915.20
7.0.310.0000.01215.49
7.0.300.0030.01015.36
7.0.290.0050.00915.20
7.0.280.0140.00315.34
7.0.270.0110.00415.35
7.0.260.0060.01015.36
7.0.250.0070.00715.45
7.0.240.0000.01215.45
7.0.230.0030.01015.48
7.0.220.0000.01315.46
7.0.210.0120.00615.56
7.0.200.0050.00716.19
7.0.190.0000.01815.53
7.0.180.0000.01315.34
7.0.170.0090.00615.19
7.0.160.0110.00315.16
7.0.150.0070.00715.46
7.0.140.0030.04018.77
7.0.130.0040.00415.21
7.0.120.0030.00815.60
7.0.110.0000.01515.45
7.0.100.0000.01315.59
7.0.90.0070.00715.39
7.0.80.0060.00915.42
7.0.70.0040.00715.46
7.0.60.0080.04017.82
7.0.50.0080.02116.73
7.0.40.0070.02316.73
7.0.30.0200.03516.73
7.0.20.0070.02916.86
7.0.10.0160.02416.82
7.0.00.0070.04816.61
5.6.400.0080.00515.67
5.6.390.0060.00615.06
5.6.380.0100.00715.20
5.6.370.0040.01115.64
5.6.360.0000.01315.27
5.6.350.0040.01715.23
5.6.340.0030.01615.57
5.6.330.0100.00715.64
5.6.320.0060.01215.33
5.6.310.0030.01015.46
5.6.300.0070.00715.20
5.6.290.0040.01215.16
5.6.280.0050.04018.67
5.6.270.0080.00815.20
5.6.260.0060.01215.24
5.6.250.0040.00815.23
5.6.240.0060.00915.32
5.6.230.0000.01815.45
5.6.220.0070.00315.39
5.6.210.0070.04318.44
5.6.200.0050.04817.30
5.6.190.0090.02418.37
5.6.180.2030.02918.37
5.6.170.0200.04018.39
5.6.160.0050.03318.24
5.6.150.0050.04917.19
5.6.140.0080.04617.30
5.6.130.0070.04317.34
5.6.120.0100.04418.82
5.6.110.0030.04818.52
5.6.100.0070.02718.70
5.6.90.0080.04118.61
5.6.80.0090.04018.33
5.6.70.0700.02018.46
5.6.60.0040.01215.32
5.6.50.0140.00315.05
5.6.40.0100.00715.19
5.6.30.0030.01015.14
5.6.20.0070.00715.46
5.6.10.0000.01715.32
5.6.00.0070.01014.98
5.5.380.0060.00915.43
5.5.370.0070.00715.73
5.5.360.0030.01015.07
5.5.350.0050.04518.32
5.5.340.0080.02117.09
5.5.330.0070.04518.04
5.5.320.0030.03418.23
5.5.310.0180.04318.37
5.5.300.0060.04217.18
5.5.290.0130.03117.21
5.5.280.0030.02818.48
5.5.270.0070.02818.47
5.5.260.0070.04718.69
5.5.250.0070.02318.65
5.5.240.0050.04518.19
5.5.230.0050.01315.54
5.5.220.0040.01415.48
5.5.210.0110.00615.46
5.5.200.0070.01115.23
5.5.190.0030.01015.23
5.5.180.0090.00315.14
5.5.170.0030.01015.40
5.5.160.0080.00815.62
5.5.150.0090.00915.49
5.5.140.0120.00315.28
5.5.130.0000.01415.49
5.5.120.0050.00515.46
5.5.110.0100.00715.19
5.5.100.0030.01015.35
5.5.90.0000.01515.32
5.5.80.0030.01515.22
5.5.70.0030.01515.53
5.5.60.0040.01215.38
5.5.50.0130.00315.13
5.5.40.0000.01415.41
5.5.30.0060.00615.37
5.5.20.0030.01015.32
5.5.10.0030.01415.18
5.5.00.0080.00615.54
5.4.450.0500.03015.92
5.4.440.0440.03416.02
5.4.430.0070.03016.23
5.4.420.0430.00315.93
5.4.410.0130.02715.88
5.4.400.0150.03015.55
5.4.390.0180.02715.62
5.4.380.0140.02915.62
5.4.370.0050.02615.58
5.4.360.0080.02615.76
5.4.350.0070.02412.30
5.4.340.0080.02212.36
5.4.330.0060.00911.89
5.4.320.0100.02212.39
5.4.310.0040.03012.50
5.4.300.0080.02612.74
5.4.290.0040.02612.50
5.4.280.0090.02212.50
5.4.270.0050.02612.33
5.4.260.0070.03812.42
5.4.250.0080.03412.45
5.4.240.0090.04012.62
5.4.230.0130.03612.41
5.4.220.0110.03312.49
5.4.210.0110.03412.40
5.4.200.0120.03912.55
5.4.190.0080.03812.45
5.4.180.0120.04212.37
5.4.170.0040.03512.51
5.4.160.0050.03712.45
5.4.150.0100.02812.28
5.4.140.0060.03312.32
5.4.130.0110.03012.39
5.4.120.0080.03212.53
5.4.110.0090.04512.39
5.4.100.0110.03812.36
5.4.90.0100.04212.32
5.4.80.0060.03512.40
5.4.70.0100.03212.32
5.4.60.0110.03112.41
5.4.50.0110.03112.49
5.4.40.0040.03312.34
5.4.30.0100.02212.32
5.4.20.0090.03412.34
5.4.10.0080.02812.36
5.4.00.0080.03012.06
5.3.290.0050.02611.87
5.3.280.0070.02911.81
5.3.270.0130.04411.83
5.3.260.0060.02711.82
5.3.250.0050.02411.82
5.3.240.0060.02311.82
5.3.230.0100.04011.82
5.3.220.0040.02711.80
5.3.210.0070.02311.80
5.3.200.0070.03111.80
5.3.190.0050.02511.80
5.3.180.0060.02611.80
5.3.170.0080.02211.80
5.3.160.0050.02811.80
5.3.150.0040.03211.80
5.3.140.0100.02711.79
5.3.130.0090.02111.79
5.3.120.0040.02511.79
5.3.110.0060.02411.79
5.3.100.0060.02211.52
5.3.90.0060.02311.51
5.3.80.0080.02611.50
5.3.70.0100.02911.50
5.3.60.0100.03011.49
5.3.50.0070.03211.46
5.3.40.0080.02911.46
5.3.30.0030.03211.43
5.3.20.0080.02911.31
5.3.10.0100.02711.30
5.3.00.0080.02611.29
5.2.170.0090.0419.15
5.2.160.0090.0429.15
5.2.150.0050.0429.15
5.2.140.0080.0419.15
5.2.130.0100.0389.11
5.2.120.0110.0379.11
5.2.110.0100.0359.11
5.2.100.0080.0399.12
5.2.90.0070.0409.11
5.2.80.0070.0399.11
5.2.70.0060.0419.11
5.2.60.0100.0349.05
5.2.50.0050.0379.03
5.2.40.0050.0359.00
5.2.30.0100.0348.99
5.2.20.0050.0378.98
5.2.10.0120.0308.91
5.2.00.0100.0368.77
5.1.60.0080.0308.04
5.1.50.0060.0298.05
5.1.40.0070.0328.03
5.1.30.0060.0378.38
5.1.20.0070.0348.39
5.1.10.0100.0328.12
5.1.00.0080.0348.12
5.0.50.0050.0286.60
5.0.40.0060.0256.46
5.0.30.0030.0416.27
5.0.20.0090.0256.24
5.0.10.0030.0306.22
5.0.00.0110.0366.21
4.4.90.0050.0234.78
4.4.80.0050.0214.76
4.4.70.0030.0234.75
4.4.60.0060.0194.76
4.4.50.0030.0224.77
4.4.40.0040.0314.71
4.4.30.0060.0184.76
4.4.20.0050.0194.84
4.4.10.0010.0244.85
4.4.00.0070.0324.76
4.3.110.0050.0204.67
4.3.100.0030.0204.66
4.3.90.0050.0194.63
4.3.80.0050.0274.59
4.3.70.0020.0184.63
4.3.60.0030.0154.62
4.3.50.0030.0204.63
4.3.40.0040.0294.54
4.3.30.0070.0163.27
4.3.20.0060.0183.25
4.3.10.0050.0183.21
4.3.00.0100.0277.15

preferences:
41.25 ms | 401 KiB | 5 Q