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.0160.00618.68
8.3.50.0100.01122.17
8.3.40.0100.00618.72
8.3.30.0090.00619.17
8.3.20.0040.00420.29
8.3.10.0040.00422.09
8.3.00.0040.00422.27
8.2.180.0040.01116.63
8.2.170.0040.01122.96
8.2.160.0100.00320.71
8.2.150.0000.00824.18
8.2.140.0000.00724.66
8.2.130.0040.00426.16
8.2.120.0030.00719.48
8.2.110.0080.00822.09
8.2.100.0040.00820.88
8.2.90.0040.00419.36
8.2.80.0060.00317.97
8.2.70.0030.00617.50
8.2.60.0040.00418.05
8.2.50.0090.00018.07
8.2.40.0000.00818.34
8.2.30.0040.00418.13
8.2.20.0080.00017.62
8.2.10.0040.00417.62
8.2.00.0000.00917.62
8.1.280.0140.00025.92
8.1.270.0000.00723.99
8.1.260.0000.00826.35
8.1.250.0080.00028.09
8.1.240.0060.00323.80
8.1.230.0080.00319.16
8.1.220.0040.00417.78
8.1.210.0000.00818.77
8.1.200.0040.00717.35
8.1.190.0050.00317.53
8.1.180.0050.00318.73
8.1.170.0080.00018.64
8.1.160.0000.00722.00
8.1.150.0000.00718.56
8.1.140.0060.00317.40
8.1.130.0030.00317.82
8.1.120.0030.00317.33
8.1.110.0000.00817.48
8.1.100.0050.00317.37
8.1.90.0020.00517.42
8.1.80.0000.00717.42
8.1.70.0030.00317.39
8.1.60.0000.00817.46
8.1.50.0050.00217.53
8.1.40.0040.00417.38
8.1.30.0000.00817.46
8.1.20.0030.00617.55
8.1.10.0040.00417.48
8.1.00.0000.00717.36
8.0.300.0070.00018.77
8.0.290.0000.00717.18
8.0.280.0060.00318.44
8.0.270.0070.00017.23
8.0.260.0040.00416.81
8.0.250.0040.00416.98
8.0.240.0030.00316.93
8.0.230.0040.00416.98
8.0.220.0030.00316.80
8.0.210.0000.00716.77
8.0.200.0000.00616.94
8.0.190.0060.00316.84
8.0.180.0040.00416.93
8.0.170.0000.00716.95
8.0.160.0040.00417.01
8.0.150.0050.00216.76
8.0.140.0020.00516.83
8.0.130.0040.00413.29
8.0.120.0050.00316.75
8.0.110.0000.00916.78
8.0.100.0070.00016.95
8.0.90.0070.00016.93
8.0.80.0060.01016.84
8.0.70.0080.00016.83
8.0.60.0070.00016.74
8.0.50.0040.00416.80
8.0.30.0100.01217.08
8.0.20.0070.01017.40
8.0.10.0070.00017.10
8.0.00.0120.00716.70
7.4.330.0050.00015.04
7.4.320.0060.00016.43
7.4.300.0030.00316.60
7.4.290.0000.00716.59
7.4.280.0070.00016.62
7.4.270.0030.00516.50
7.4.260.0000.00816.48
7.4.250.0070.00016.59
7.4.240.0030.00416.52
7.4.230.0000.00716.63
7.4.220.0150.00316.61
7.4.210.0140.00516.57
7.4.200.0030.00316.42
7.4.190.0030.00316.68
7.4.160.0110.00616.30
7.4.150.0080.00817.40
7.4.140.0130.00717.86
7.4.130.0110.00716.44
7.4.120.0110.00616.44
7.4.110.0030.01316.40
7.4.100.0120.00616.45
7.4.90.0080.00816.48
7.4.80.0080.00819.39
7.4.70.0030.01416.54
7.4.60.0110.00816.50
7.4.50.0000.00816.38
7.4.40.0120.00322.77
7.4.30.0030.01316.36
7.4.00.0080.00815.11
7.3.330.0060.00013.12
7.3.320.0060.00013.22
7.3.310.0000.00716.38
7.3.300.0030.00316.35
7.3.290.0080.00816.21
7.3.280.0080.01016.23
7.3.270.0140.00417.40
7.3.260.0100.01016.59
7.3.250.0110.00916.36
7.3.240.0130.00316.27
7.3.230.0070.01016.39
7.3.210.0110.00616.52
7.3.200.0070.01719.39
7.3.190.0090.00916.32
7.3.180.0050.01016.44
7.3.170.0170.00016.42
7.3.160.0060.00916.62
7.3.120.0070.00714.80
7.2.330.0080.00816.77
7.2.320.0120.00816.73
7.2.310.0100.00716.63
7.2.300.0120.00616.79
7.2.290.0060.00916.75
7.2.00.0100.00519.47
7.1.100.0000.01018.38
7.1.70.0000.01016.93
7.1.60.0100.01019.82
7.1.50.0040.00816.79
7.1.00.0000.09322.35
7.0.200.0050.00216.64
7.0.140.0030.07321.95
7.0.100.0030.08019.86
7.0.90.0130.07719.96
7.0.80.0070.06019.85
7.0.70.0100.05719.98
7.0.60.0100.07019.96
7.0.50.0400.05320.20
7.0.40.0070.04719.95
7.0.30.0100.08720.00
7.0.20.0100.07720.14
7.0.10.0070.07720.02
7.0.00.0130.05320.09
5.6.280.0030.07321.12
5.6.250.0130.07720.66
5.6.240.0230.05320.63
5.6.230.0130.07320.50
5.6.220.0070.07720.70
5.6.210.0100.08020.55
5.6.200.0100.08721.07
5.6.190.0070.04721.08
5.6.180.0070.06021.16
5.6.170.0100.08021.11
5.6.160.0100.07320.94
5.6.150.0000.06721.01
5.6.140.0070.08320.97
5.6.130.0100.08021.01
5.6.120.0100.06321.04
5.6.110.0100.06720.99
5.6.100.0070.08021.11
5.6.90.0170.07320.91
5.6.80.0030.08720.47
5.6.70.0100.04020.33
5.6.60.0030.04320.32
5.6.50.0100.03720.43
5.6.40.0070.04020.40
5.6.30.0000.04720.39
5.6.20.0100.04020.43
5.6.10.0070.03720.29
5.6.00.0030.04020.41
5.5.380.0200.06720.39
5.5.370.0100.07320.54
5.5.360.0230.06720.38
5.5.350.0030.09020.41
5.5.340.0030.08720.89
5.5.330.0000.08320.81
5.5.320.0030.04720.89
5.5.310.0070.06020.83
5.5.300.0100.08320.89
5.5.290.0100.07720.80
5.5.280.0200.06320.86
5.5.270.0170.07020.82
5.5.260.0070.08020.78
5.5.250.0100.08020.71
5.5.240.0100.07320.11
5.5.230.0070.04020.21
5.5.220.0000.04720.16
5.5.210.0100.05320.24
5.5.200.0230.02720.22
5.5.190.0130.03320.18
5.5.180.0030.04720.21
5.5.160.0070.03320.20
5.5.150.0070.04020.13
5.5.140.0030.04020.21
5.5.130.0100.03320.07
5.5.120.0030.04320.12
5.5.110.0030.04020.13
5.5.100.0100.03020.11
5.5.90.0100.03720.14
5.5.80.0000.04320.06
5.5.70.0100.04020.05
5.5.60.0070.03720.14
5.5.50.0030.04020.03
5.5.40.0070.03320.02
5.5.30.0100.03719.89
5.5.20.0070.03719.92
5.5.10.0030.04020.10
5.5.00.0000.04020.03
5.4.450.0100.06019.36
5.4.440.0070.08019.35
5.4.430.0070.07019.37
5.4.420.0100.06319.27
5.4.410.0000.08319.07
5.4.400.0030.04719.05
5.4.390.0070.04319.04
5.4.380.0070.04019.16
5.4.370.0230.02719.02
5.4.360.0130.03319.04
5.4.350.0030.04318.91
5.4.340.0100.03319.05
5.4.320.0000.04319.16
5.4.310.0070.03719.03
5.4.300.0030.04018.90
5.4.290.0030.04019.20
5.4.280.0000.04319.03
5.4.270.0030.04019.18
5.4.260.0030.04319.18
5.4.250.0030.04319.17
5.4.240.0100.03719.15
5.4.230.0030.03719.04
5.4.220.0200.08019.15
5.4.210.0100.03019.17
5.4.200.0100.03019.04
5.4.190.0070.04319.02
5.4.180.0030.04019.11
5.4.170.0170.03018.93
5.4.160.0030.03319.07
5.4.150.0000.04019.13
5.4.140.0030.03716.38
5.4.130.0100.03016.35
5.4.120.0030.03716.35
5.4.110.0100.05016.48
5.4.100.0070.03316.50
5.4.90.0000.04316.51
5.4.80.0000.04016.47
5.4.70.0000.04016.48
5.4.60.0030.04016.38
5.4.50.0070.02716.44
5.4.40.0030.03716.53
5.4.30.0130.03016.24
5.4.20.0030.03716.30
5.4.10.0070.03016.33
5.4.00.0170.05715.78
5.3.290.0000.04314.71
5.3.280.0030.04014.55
5.3.270.0070.04014.60
5.3.260.0070.03314.66
5.3.250.0030.07014.62
5.3.240.0030.03714.58
5.3.230.0070.03314.55
5.3.220.0070.03314.52
5.3.210.0130.02314.62
5.3.200.0170.02014.57
5.3.190.0070.03014.62
5.3.180.0070.04014.66
5.3.170.0070.03014.66
5.3.160.0100.04314.62
5.3.150.0000.03714.57
5.3.140.0000.04014.51
5.3.130.0030.04314.66
5.3.120.0070.03314.47
5.3.110.0100.03314.53
5.3.100.0100.07314.01
5.3.90.0000.08314.07
5.3.80.0070.06314.04
5.3.70.0000.04314.02
5.3.60.0170.06314.11
5.3.50.0100.07014.05
5.3.40.0030.04013.84
5.3.30.0030.07014.02
5.3.20.0030.04713.79
5.3.10.0030.06713.75
5.3.00.0100.05013.77
5.2.170.0030.06312.25
5.2.160.0000.04012.25
5.2.150.0100.05312.25
5.2.140.0030.03712.25
5.2.130.0100.03012.25
5.2.120.0070.05312.25
5.2.110.0070.06012.25
5.2.100.0100.05712.25
5.2.90.0070.05712.25
5.2.80.0070.06312.25
5.2.70.0030.05312.25
5.2.60.0030.05312.25
5.2.50.0100.05012.25
5.2.40.0070.06012.25
5.2.30.0130.05012.25
5.2.20.0000.05012.25
5.2.10.0100.04312.25
5.2.00.0030.06312.25
5.1.60.0170.04012.25
5.1.50.0030.05012.25
5.1.40.0000.06012.25
5.1.30.0070.04012.25
5.1.20.0030.05712.25
5.1.10.0030.05712.25
5.1.00.0030.05012.25
5.0.50.0030.03712.25
5.0.40.0030.04712.25
5.0.30.0000.06712.25
5.0.20.0030.03712.25
5.0.10.0030.02712.25
5.0.00.0000.06712.25
4.4.90.0030.04712.25
4.4.80.0000.03712.25
4.4.70.0030.02712.25
4.4.60.0030.03312.25
4.4.50.0030.03312.25
4.4.40.0000.05312.25
4.4.30.0030.03012.25
4.4.20.0030.03312.25
4.4.10.0000.04012.25
4.4.00.0030.05712.25
4.3.110.0030.03012.25
4.3.100.0030.03312.25
4.3.90.0030.03012.25
4.3.80.0000.05012.25
4.3.70.0030.02012.25
4.3.60.0100.02712.25
4.3.50.0070.03312.25
4.3.40.0000.04312.25
4.3.30.0000.03712.25
4.3.20.0030.03712.25
4.3.10.0030.03312.25
4.3.00.0100.02712.25

preferences:
48.77 ms | 401 KiB | 5 Q