3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( 2 => 'string2', 0 => 'string1', 4 => 'string3', 5 => 'string4'); $arrays =$array; print_r($array); $array=array(); $i=0; foreach($arrays as $k => $item) { $array[$i]=$item; unset($arrays[$k]); $i++; } 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.0140.00016.38
8.3.50.0070.01222.11
8.3.40.0070.00718.63
8.3.30.0100.00719.08
8.3.20.0050.00320.24
8.3.10.0080.00021.76
8.3.00.0070.00419.02
8.2.180.0090.00916.50
8.2.170.0000.01522.96
8.2.160.0140.00422.21
8.2.150.0040.00424.18
8.2.140.0070.00024.66
8.2.130.0070.00026.16
8.2.120.0080.00019.76
8.2.110.0000.01020.87
8.2.100.0120.00017.63
8.2.90.0060.00319.21
8.2.80.0030.00617.97
8.2.70.0150.00417.38
8.2.60.0030.00617.93
8.2.50.0000.00818.07
8.2.40.0040.00418.24
8.2.30.0080.00018.13
8.2.20.0000.00817.74
8.2.10.0030.00518.14
8.2.00.0040.00417.62
8.1.280.0140.00325.92
8.1.270.0060.00318.95
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0000.01023.79
8.1.230.0100.00320.78
8.1.220.0040.00417.77
8.1.210.0050.00318.77
8.1.200.0050.00517.35
8.1.190.0000.00817.34
8.1.180.0040.00418.10
8.1.170.0040.00420.21
8.1.160.0030.00321.96
8.1.150.0050.00318.88
8.1.140.0050.00317.39
8.1.130.0050.00217.88
8.1.120.0040.00417.48
8.1.110.0040.00417.42
8.1.100.0070.00017.44
8.1.90.0000.00717.50
8.1.80.0000.00817.36
8.1.70.0030.00317.42
8.1.60.0030.00517.58
8.1.50.0040.00417.46
8.1.40.0000.00817.50
8.1.30.0000.00817.48
8.1.20.0000.00817.57
8.1.10.0070.00017.38
8.1.00.0030.00517.49
8.0.300.0050.00318.77
8.0.290.0000.00716.75
8.0.280.0000.00718.36
8.0.270.0000.00817.25
8.0.260.0000.00717.27
8.0.250.0000.00716.85
8.0.240.0070.00016.84
8.0.230.0030.00316.91
8.0.220.0050.00216.78
8.0.210.0030.00316.90
8.0.200.0000.00616.96
8.0.190.0070.00016.93
8.0.180.0040.00416.96
8.0.170.0000.00716.84
8.0.160.0000.00716.95
8.0.150.0040.00416.86
8.0.140.0030.00316.83
8.0.130.0050.00013.25
8.0.120.0050.00316.91
8.0.110.0000.00716.81
8.0.100.0040.00416.74
8.0.90.0000.00716.76
8.0.80.0060.00916.84
8.0.70.0000.00716.93
8.0.60.0040.00416.76
8.0.50.0000.00716.91
8.0.30.0070.01416.99
8.0.20.0080.01117.40
8.0.10.0070.00016.86
8.0.00.0110.00616.63
7.4.330.0000.00615.11
7.4.320.0000.00616.61
7.4.300.0030.00316.64
7.4.290.0030.00316.49
7.4.280.0030.00316.51
7.4.270.0000.00616.56
7.4.260.0000.00716.57
7.4.250.0000.00916.49
7.4.240.0040.00416.50
7.4.230.0000.00716.39
7.4.220.0070.01516.56
7.4.210.0040.01116.61
7.4.200.0040.00416.71
7.4.160.0030.01316.41
7.4.150.0110.00717.40
7.4.140.0100.01017.86
7.4.130.0100.00916.52
7.4.120.0080.00916.49
7.4.110.0100.00716.49
7.4.100.0130.00616.59
7.4.90.0070.01116.51
7.4.80.0090.01316.55
7.4.70.0100.00616.44
7.4.60.0060.01016.49
7.4.50.0000.00416.40
7.4.40.0040.01216.48
7.4.30.0130.00416.52
7.4.00.0030.01215.02
7.3.330.0060.00013.27
7.3.320.0080.00413.14
7.3.310.0070.00016.19
7.3.300.0000.00716.32
7.3.290.0120.00216.37
7.3.280.0030.01416.36
7.3.270.0070.01117.40
7.3.260.0140.00416.67
7.3.250.0100.00916.47
7.3.240.0100.00616.55
7.3.230.0140.00916.39
7.3.210.0090.00916.35
7.3.200.0130.00619.39
7.3.190.0050.01416.70
7.3.180.0100.00616.26
7.3.170.0160.00616.39
7.3.160.0070.01016.48
7.2.330.0070.01016.70
7.2.320.0110.00616.63
7.2.310.0070.01216.56
7.2.300.0070.01116.61
7.2.290.0070.01316.46
7.2.00.0040.00819.38
7.1.100.0040.00718.05
7.1.70.0040.01117.25
7.1.60.0120.01219.46
7.1.50.0070.01416.76
7.1.00.0070.07322.48
7.0.200.0130.01014.96
7.0.140.0030.07321.99
7.0.60.0100.08019.94
7.0.50.0130.07317.80
7.0.40.0030.07720.15
7.0.30.0170.04320.06
7.0.20.0330.07020.24
7.0.10.0100.07320.33
7.0.00.0070.08320.12
5.6.280.0070.07021.09
5.6.210.0170.07720.54
5.6.200.0100.08318.18
5.6.190.0030.06720.46
5.6.180.0600.05320.61
5.6.170.0270.05020.56
5.6.160.0130.06320.43
5.6.150.0170.06718.18
5.6.140.0070.05318.27
5.6.130.0030.08318.24
5.6.120.0170.07021.00
5.6.110.0070.08021.01
5.6.100.0100.08020.95
5.6.90.0100.08020.98
5.6.80.0070.08320.40
5.5.350.0330.07720.44
5.5.340.0100.07718.08
5.5.330.0000.05320.56
5.5.320.0000.09320.34
5.5.310.0230.05020.25
5.5.300.0100.08317.96
5.5.290.0070.08717.91
5.5.280.0130.05020.73
5.5.270.0070.08720.75
5.5.260.0100.08320.93
5.5.250.0170.07320.46
5.5.240.0200.03020.25
5.4.450.0570.06019.46
5.4.440.0300.06719.38
5.4.430.0870.05719.30
5.4.420.0930.05319.58
5.4.410.1030.04719.35
5.4.400.0970.05319.15
5.4.390.0170.05018.45
5.4.380.0170.05318.80
5.4.370.0200.04718.48
5.4.360.0170.05318.73
5.4.350.0100.08318.73
5.4.340.0230.06718.72
5.4.320.0230.06018.74
5.4.310.0270.04018.68
5.4.300.0270.04018.55
5.4.290.0300.06018.78
5.4.280.0230.06718.45
5.4.270.0200.07018.50
5.4.260.0230.06018.52
5.4.250.0030.07018.56
5.4.240.0200.04718.70
5.4.230.0170.05018.44
5.4.220.0170.05318.77
5.4.210.0130.05018.82
5.4.200.0130.05016.59
5.4.190.0270.04018.54
5.4.180.0170.07318.82
5.4.170.0130.05718.43
5.4.160.0070.08318.68
5.4.150.0230.06018.74
5.4.140.0130.05316.44
5.4.130.0130.06716.32
5.4.120.0200.06316.19
5.4.110.0100.07316.43
5.4.100.0130.07316.32
5.4.90.0100.05316.32
5.4.80.0100.05316.16
5.4.70.0230.04016.40
5.4.60.0230.04016.25
5.4.50.0100.05016.20
5.4.40.0100.05716.29
5.4.30.0130.05016.21
5.4.20.0100.05316.12
5.4.10.0130.04716.25
5.4.00.0230.03715.63
5.3.290.0170.05714.86
5.3.280.0030.06314.59
5.3.270.0170.05014.82
5.3.260.0170.05014.76
5.3.250.0130.05314.82
5.3.240.0270.04314.70
5.3.230.0230.05314.73
5.3.220.0170.05014.67
5.3.210.0100.05714.58
5.3.200.0170.04714.58
5.3.190.0130.05314.78
5.3.180.0130.05014.55
5.3.170.0100.05314.74
5.3.160.0130.05014.61
5.3.150.0100.05314.73
5.3.140.0230.06314.56
5.3.130.0100.05714.60
5.3.120.0130.05314.72
5.3.110.0100.05714.58
5.3.100.0130.05014.06
5.3.90.0130.05014.06
5.3.80.0030.06014.08
5.3.70.0070.06014.22
5.3.60.0200.05014.05
5.3.50.0130.05013.99
5.3.40.0100.05014.00
5.3.30.0130.04713.93
5.3.20.0170.05013.73
5.3.10.0170.04713.75
5.3.00.0230.04013.74
5.2.170.0100.04311.21
5.2.160.0070.04311.18
5.2.150.0130.04311.34
5.2.140.0130.04011.26
5.2.130.0130.03711.14
5.2.120.0170.03311.12
5.2.110.0170.03711.20
5.2.100.0030.04711.12
5.2.90.0030.04711.12
5.2.80.0130.03711.19
5.2.70.0100.04011.11
5.2.60.0030.04711.02
5.2.50.0230.03011.23
5.2.40.0030.04711.04
5.2.30.0170.03311.00
5.2.20.0100.03710.95
5.2.10.0130.03710.84
5.2.00.0230.05010.76
5.1.60.0100.03710.11
5.1.50.0030.04010.10
5.1.40.0070.0379.99
5.1.30.0100.03310.34
5.1.20.0000.04310.50
5.1.10.0070.04010.09
5.1.00.0130.03010.10
5.0.50.0170.0208.64
5.0.40.0030.0308.41
5.0.30.0100.0408.32
5.0.20.0100.0238.32
5.0.10.0030.0308.15
5.0.00.0070.0408.35
4.4.90.0030.0236.77
4.4.80.0070.0206.77
4.4.70.0000.0276.77
4.4.60.0000.0276.77
4.4.50.0100.0176.77
4.4.40.0070.0336.77
4.4.30.0000.0276.77
4.4.20.0030.0236.77
4.4.10.0030.0276.77
4.4.00.0030.0376.77
4.3.110.0030.0236.77
4.3.100.0000.0236.77
4.3.90.0070.0176.77
4.3.80.0000.0376.77
4.3.70.0100.0136.77
4.3.60.0000.0236.77
4.3.50.0000.0276.77
4.3.40.0100.0276.77
4.3.30.0000.0276.77
4.3.20.0070.0206.77
4.3.10.0000.0276.77
4.3.00.0000.03014.42

preferences:
57.24 ms | 401 KiB | 5 Q