3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Create a simple array. $array = array(1, 2, 3, 4, 5); print_r($array); // Now delete every item, but leave the array itself intact: foreach ($array as $i => $value) { echo $array[2]; } print_r($array); // Append an item (note that the new key is 5, instead of 0). $array[] = 6; print_r($array); // Re-index: $array = array_values($array); $array[] = 7; print_r($array);

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.3.60.0040.01118.43
8.3.50.0120.00521.21
8.3.40.0070.00718.84
8.3.30.0120.00618.77
8.3.20.0090.00918.73
8.3.10.0080.00021.14
8.3.00.0040.00421.95
8.2.180.0090.00616.63
8.2.170.0090.00922.96
8.2.160.0050.00820.47
8.2.150.0000.00824.18
8.2.140.0060.00324.66
8.2.130.0080.00026.16
8.2.120.0040.00421.06
8.2.110.0050.00520.47
8.2.100.0000.01217.84
8.2.90.0000.00819.11
8.2.80.0030.00618.05
8.2.70.0000.00817.25
8.2.60.0000.00818.05
8.2.50.0040.00418.07
8.2.40.0040.00418.28
8.2.30.0000.00721.09
8.2.20.0080.00017.66
8.2.10.0000.00817.62
8.2.00.0040.00417.84
8.1.280.0110.00325.92
8.1.270.0000.00823.99
8.1.260.0100.00626.35
8.1.250.0090.00028.09
8.1.240.0030.00622.45
8.1.230.0070.00320.97
8.1.220.0000.00818.77
8.1.210.0000.00918.88
8.1.200.0050.00517.36
8.1.190.0000.00717.53
8.1.180.0060.00618.10
8.1.170.0040.00418.51
8.1.160.0040.00418.79
8.1.150.0040.00418.60
8.1.140.0040.00417.41
8.1.130.0030.00317.74
8.1.120.0050.00217.45
8.1.110.0070.00017.46
8.1.100.0000.00817.43
8.1.90.0070.00017.41
8.1.80.0050.00217.49
8.1.70.0000.00817.32
8.1.60.0090.00017.54
8.1.50.0040.00417.46
8.1.40.0000.00717.39
8.1.30.0040.00417.54
8.1.20.0090.00017.56
8.1.10.0040.00417.55
8.1.00.0040.00417.43
8.0.300.0060.00420.07
8.0.290.0000.00717.05
8.0.280.0000.00718.41
8.0.270.0030.00317.25
8.0.260.0040.00416.72
8.0.250.0020.00516.89
8.0.240.0030.00516.84
8.0.230.0000.00716.96
8.0.220.0020.00516.86
8.0.210.0030.00316.82
8.0.200.0030.00616.98
8.0.190.0040.00416.99
8.0.180.0070.00016.95
8.0.170.0050.00316.80
8.0.160.0000.00716.86
8.0.150.0000.00716.89
8.0.140.0000.00716.82
8.0.130.0000.00613.32
8.0.120.0040.00416.89
8.0.110.0040.00416.95
8.0.100.0030.00316.90
8.0.90.0000.00716.70
8.0.80.0030.01216.85
8.0.70.0070.00016.89
8.0.60.0040.00416.83
8.0.50.0000.00716.88
8.0.30.0110.00817.20
8.0.20.0130.00517.40
8.0.10.0050.00316.82
8.0.00.0060.01216.76
7.4.330.0020.00216.66
7.4.320.0030.00316.42
7.4.300.0030.00316.50
7.4.290.0050.00216.52
7.4.280.0090.00016.48
7.4.270.0000.00716.50
7.4.260.0060.00013.23
7.4.250.0040.00416.52
7.4.240.0040.00416.48
7.4.230.0000.00816.33
7.4.220.0060.01216.55
7.4.210.0090.00616.59
7.4.200.0030.00316.47
7.4.190.0030.00316.37
7.4.160.0140.00416.46
7.4.150.0100.00717.40
7.4.140.0070.00917.86
7.4.130.0100.00816.52
7.4.120.0090.01216.48
7.4.110.0110.00516.48
7.4.100.0070.01016.65
7.4.90.0100.00716.33
7.4.80.0070.01019.39
7.4.70.0090.00916.39
7.4.60.0060.00916.49
7.4.50.0000.00816.39
7.4.40.0070.01022.77
7.4.30.0040.01216.37
7.4.00.0030.01415.10
7.3.330.0050.00013.30
7.3.320.0000.00513.12
7.3.310.0000.00716.42
7.3.300.0070.00016.27
7.3.290.0000.01916.21
7.3.280.0070.00916.27
7.3.270.0120.00417.40
7.3.260.0100.00818.24
7.3.250.0060.01116.31
7.3.240.0060.01216.47
7.3.230.0070.01016.44
7.3.210.0090.01316.50
7.3.200.0120.01119.39
7.3.190.0120.00716.64
7.3.180.0030.01316.66
7.3.170.0030.01216.37
7.3.160.0140.00516.35
7.3.120.0050.01314.92
7.3.110.0030.01215.01
7.3.100.0060.01015.00
7.3.90.0080.00814.56
7.3.80.0030.01015.03
7.3.70.0000.01714.98
7.3.60.0040.00814.66
7.3.50.0030.01014.73
7.3.40.0110.00414.80
7.3.30.0030.01314.86
7.3.20.0030.00816.61
7.3.10.0060.00316.59
7.3.00.0070.00316.49
7.2.330.0100.00716.74
7.2.320.0090.00916.46
7.2.310.0080.01216.36
7.2.300.0080.00816.68
7.2.290.0030.01216.64
7.2.250.0100.00314.89
7.2.240.0140.00315.30
7.2.230.0050.00515.18
7.2.220.0000.01615.29
7.2.210.0030.00915.04
7.2.200.0000.01415.01
7.2.190.0030.00715.00
7.2.180.0060.00614.99
7.2.170.0000.01715.11
7.2.60.0120.00317.09
7.2.50.0000.01217.07
7.2.00.0110.00719.36
7.1.330.0030.01115.69
7.1.320.0000.01215.92
7.1.310.0100.00715.91
7.1.300.0110.00015.98
7.1.290.0040.00715.59
7.1.280.0000.01815.59
7.1.270.0080.00515.97
7.1.260.0000.00915.79
7.1.200.0000.01315.83
7.1.100.0030.00818.26
7.1.70.0080.00317.18
7.1.60.0100.01419.40
7.1.50.0070.02017.11
7.1.00.0070.03022.35
7.0.200.0150.00616.52
7.0.140.0030.07022.06
7.0.70.0830.06319.87
7.0.60.0770.06719.97
7.0.50.0830.07320.31
7.0.40.0130.05320.10
7.0.30.0130.08320.04
7.0.20.0200.08019.95
7.0.10.0170.07720.07
7.0.00.0100.07720.10
5.6.280.0000.07721.15
5.6.220.0000.07020.49
5.6.210.0030.08020.61
5.6.200.0170.08320.96
5.6.190.0130.08021.16
5.6.180.0030.07721.03
5.6.170.0070.08321.01
5.6.160.0100.09021.00
5.6.150.0170.06021.09
5.6.140.0130.05321.16
5.6.130.0130.08021.07
5.6.120.0130.03321.09
5.6.110.0130.08020.97
5.6.100.0170.07720.95
5.6.90.0100.07721.00
5.6.80.0030.08720.55
5.6.70.0100.04720.26
5.6.60.0030.04320.30
5.6.50.0070.08720.38
5.6.40.0030.08720.46
5.6.30.0100.05020.37
5.6.20.0070.05320.29
5.6.10.0100.08020.36
5.6.00.0130.07720.31
5.5.360.0070.06320.40
5.5.350.0100.06320.41
5.5.340.0130.05320.82
5.5.330.0130.05720.88
5.5.320.0100.06720.76
5.5.310.0070.08720.79
5.5.300.0070.04320.88
5.5.290.0070.08320.89
5.5.280.0070.04720.73
5.5.270.0100.08320.63
5.5.260.0000.08720.85
5.5.250.0030.05320.63
5.5.240.0130.05320.14
5.5.230.0200.06320.18
5.5.220.0130.06020.13
5.5.210.0000.05320.27
5.5.200.0100.08020.24
5.5.190.0100.07720.27
5.5.180.0030.08720.09
5.5.160.0070.07020.27
5.5.150.0030.07720.14
5.5.140.0030.08320.17
5.5.130.0000.06720.26
5.5.120.0070.06020.07
5.5.110.0170.07720.22
5.5.100.0070.08320.15
5.5.90.0100.05720.09
5.5.80.0100.04320.00
5.5.70.0070.04720.10
5.5.60.0000.06020.14
5.5.50.0100.05019.95
5.5.40.0100.07320.07
5.5.30.0100.08020.05
5.5.20.0130.07320.14
5.5.10.0100.05720.11
5.5.00.0100.04719.96
5.4.450.0100.08019.41
5.4.440.0030.05319.18
5.4.430.0030.08319.50
5.4.420.0030.07719.57
5.4.410.0130.07319.32
5.4.400.0100.04718.91
5.4.390.0130.06019.03
5.4.380.0070.06018.92
5.4.370.0200.06719.21
5.4.360.0070.07719.13
5.4.350.0030.08018.84
5.4.340.0030.05719.08
5.4.320.0030.08319.18
5.4.310.0030.07018.95
5.4.300.0000.08719.13
5.4.290.0100.07319.02
5.4.280.0100.08019.14
5.4.270.0100.03718.87
5.4.260.0170.06718.94
5.4.250.0070.05719.20
5.4.240.0030.08319.13
5.4.230.0100.05319.11
5.4.220.0100.07019.04
5.4.210.0100.04019.20
5.4.200.0130.07319.22
5.4.190.0100.08019.15
5.4.180.0070.06719.02
5.4.170.0070.07019.01
5.4.160.0030.07319.00
5.4.150.0070.03719.02
5.4.140.0100.07016.46
5.4.130.0030.08016.18
5.4.120.0070.05716.18
5.4.110.0070.05316.51
5.4.100.0100.05716.50
5.4.90.0030.07716.34
5.4.80.0130.07316.42
5.4.70.0030.07716.45
5.4.60.0030.07716.29
5.4.50.0030.07316.38
5.4.40.0130.07016.46
5.4.30.0100.06016.32
5.4.20.0070.07716.33
5.4.10.0030.07716.47
5.4.00.0070.03715.85
5.3.290.0000.08014.66
5.3.280.0070.05714.73
5.3.270.0030.05014.59
5.3.260.0030.08314.73
5.3.250.0100.03314.55
5.3.240.0170.04314.73
5.3.230.0070.08014.61
5.3.220.0130.07014.58
5.3.210.0070.08014.52
5.3.200.0130.07014.68
5.3.190.0030.08314.48
5.3.180.0070.08014.70
5.3.170.0100.06714.48
5.3.160.0130.07014.55
5.3.150.0130.05014.64
5.3.140.0200.06014.58
5.3.130.0100.08014.55
5.3.120.0170.06714.55
5.3.110.0100.05314.65
5.3.100.0000.05013.98
5.3.90.0130.07014.00
5.3.80.0130.05714.07
5.3.70.0100.06714.07
5.3.60.0100.05314.11
5.3.50.0000.08313.82
5.3.40.0130.06713.93
5.3.30.0100.06313.91
5.3.20.0000.07713.67
5.3.10.0070.07013.63
5.3.00.0100.07313.63
5.2.170.0100.06312.21
5.2.160.0030.04712.21
5.2.150.0070.06312.21
5.2.140.0070.06012.21
5.2.130.0030.06312.21
5.2.120.0000.07012.21
5.2.110.0030.04712.21
5.2.100.0030.05012.21
5.2.90.0100.06012.21
5.2.80.0100.05712.21
5.2.70.0030.05312.21
5.2.60.0070.06012.21
5.2.50.0070.05312.21
5.2.40.0030.04312.21
5.2.30.0000.06712.21
5.2.20.0030.06012.21
5.2.10.0030.06312.21
5.2.00.0100.05312.21
5.1.60.0000.05312.21
5.1.50.0030.04012.21
5.1.40.0030.03012.21
5.1.30.0000.03712.21
5.1.20.0030.05712.21
5.1.10.0000.06012.21
5.1.00.0030.05712.21
5.0.50.0030.04312.21
5.0.40.0030.02012.21
5.0.30.0000.04312.21
5.0.20.0000.02312.21
5.0.10.0000.04712.21
5.0.00.0000.04012.21
4.4.90.0030.03312.21
4.4.80.0000.04012.21
4.4.70.0070.03012.21
4.4.60.0100.03012.21
4.4.50.0070.03012.21
4.4.40.0030.05012.21
4.4.30.0070.03012.21
4.4.20.0000.04012.21
4.4.10.0100.03012.21
4.4.00.0030.03712.21
4.3.110.0000.01712.21
4.3.100.0030.01712.21
4.3.90.0000.02312.21
4.3.80.0000.05712.21
4.3.70.0030.03012.21
4.3.60.0070.03012.21
4.3.50.0000.02712.21
4.3.40.0000.03012.21
4.3.30.0030.03712.21
4.3.20.0030.03712.21
4.3.10.0030.03312.21
4.3.00.0030.03312.21

preferences:
49.15 ms | 401 KiB | 5 Q