3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( 0 => 'string1', 2 => 'string2', 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++; } var_dump(array_values($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.40.0080.00618.63
8.3.30.0070.00719.08
8.3.20.0070.00020.29
8.3.10.0040.00423.52
8.3.00.0090.00021.00
8.2.170.0040.01122.96
8.2.160.0070.00720.57
8.2.150.0050.00224.18
8.2.140.0120.00624.66
8.2.130.0030.00626.16
8.2.120.0050.00320.92
8.2.110.0110.00022.20
8.2.100.0110.00017.84
8.2.90.0080.00319.29
8.2.80.0080.00017.97
8.2.70.0080.00017.63
8.2.60.0020.00518.05
8.2.50.0050.00318.07
8.2.40.0000.00919.89
8.2.30.0070.00218.36
8.2.20.0080.00017.68
8.2.10.0040.00418.16
8.2.00.0000.00817.61
8.1.270.0130.00623.77
8.1.260.0050.00226.35
8.1.250.0070.00028.09
8.1.240.0100.01023.96
8.1.230.0080.00419.07
8.1.220.0030.00617.74
8.1.210.0000.00918.77
8.1.200.0040.00717.48
8.1.190.0040.00417.35
8.1.180.0060.00318.10
8.1.170.0040.00418.54
8.1.160.0000.00722.09
8.1.150.0000.00818.64
8.1.140.0070.00017.53
8.1.130.0030.00317.83
8.1.120.0000.00717.43
8.1.110.0000.00817.35
8.1.100.0000.00717.50
8.1.90.0070.00017.36
8.1.80.0080.00017.42
8.1.70.0000.00717.33
8.1.60.0000.00817.46
8.1.50.0000.00817.42
8.1.40.0000.00717.43
8.1.30.0050.00517.68
8.1.20.0040.00417.58
8.1.10.0070.00017.41
8.1.00.0090.00017.38
8.0.300.0000.00718.77
8.0.290.0000.00716.63
8.0.280.0040.00418.45
8.0.270.0070.00017.27
8.0.260.0030.00317.17
8.0.250.0000.00816.93
8.0.240.0080.00016.84
8.0.230.0030.00316.89
8.0.220.0030.00316.75
8.0.210.0000.00716.82
8.0.200.0070.00016.96
8.0.190.0030.00616.84
8.0.180.0040.00416.92
8.0.170.0000.00816.90
8.0.160.0030.00316.89
8.0.150.0070.00016.71
8.0.140.0000.00716.88
8.0.130.0000.00513.30
8.0.120.0040.00416.89
8.0.110.0000.00816.89
8.0.100.0000.00716.69
8.0.90.0040.00416.77
8.0.80.0040.01216.77
8.0.70.0020.00516.71
8.0.60.0030.00316.93
8.0.50.0070.00016.93
8.0.30.0110.00716.99
8.0.20.0070.01217.40
8.0.10.0040.00416.89
8.0.00.0100.00916.80
7.4.330.0000.00515.04
7.4.320.0030.00316.54
7.4.300.0060.00016.39
7.4.290.0030.00716.65
7.4.280.0040.00416.59
7.4.270.0070.00016.51
7.4.260.0040.00416.59
7.4.250.0000.00816.61
7.4.240.0030.00316.55
7.4.230.0070.00016.34
7.4.220.0100.00716.53
7.4.210.0090.00616.47
7.4.200.0030.00316.60
7.4.160.0080.00816.63
7.4.150.0120.00617.40
7.4.140.0090.01417.86
7.4.130.0110.00616.45
7.4.120.0090.00816.43
7.4.110.0160.00016.50
7.4.100.0160.00716.51
7.4.90.0120.00616.48
7.4.80.0070.01319.39
7.4.70.0110.00616.61
7.4.60.0060.01216.48
7.4.50.0050.00316.26
7.4.40.0060.01216.51
7.4.30.0090.00616.75
7.4.00.0100.00515.02
7.3.330.0000.00813.31
7.3.320.0060.00013.16
7.3.310.0040.00416.28
7.3.300.0070.00016.28
7.3.290.0070.00716.35
7.3.280.0110.00816.36
7.3.270.0070.01017.40
7.3.260.0060.01216.29
7.3.250.0100.01016.44
7.3.240.0070.01116.34
7.3.230.0030.01316.49
7.3.210.0060.01216.23
7.3.200.0110.00819.39
7.3.190.0000.01616.39
7.3.180.0030.01316.43
7.3.170.0080.00816.54
7.3.160.0080.00816.31
7.3.120.0090.00914.78
7.3.110.0090.00614.61
7.3.100.0100.00614.94
7.3.90.0040.01114.76
7.3.80.0070.00714.96
7.3.70.0030.01214.75
7.3.60.0030.00614.96
7.3.50.0030.01014.78
7.3.40.0030.01315.02
7.3.30.0070.00714.55
7.3.20.0090.00616.66
7.3.10.0080.00816.48
7.3.00.0040.00716.65
7.2.330.0150.00316.82
7.2.320.0090.00816.59
7.2.310.0070.01016.72
7.2.300.0070.01616.52
7.2.290.0060.01316.73
7.2.250.0120.00615.18
7.2.240.0040.01515.14
7.2.230.0090.01114.97
7.2.220.0030.01014.73
7.2.210.0030.01014.74
7.2.200.0040.00815.13
7.2.190.0090.00315.07
7.2.180.0090.00914.58
7.2.170.0040.01214.95
7.2.130.0110.00016.93
7.2.120.0030.00917.00
7.2.110.0040.01216.98
7.2.100.0080.00317.05
7.2.90.0070.00716.86
7.2.80.0070.00316.88
7.2.70.0040.01116.39
7.2.60.0030.01016.53
7.2.50.0090.00316.93
7.2.40.0040.00717.00
7.2.30.0080.00316.87
7.2.20.0030.01016.63
7.2.10.0030.00616.57
7.2.00.0020.01018.09
7.1.330.0000.01115.60
7.1.320.0070.00315.85
7.1.310.0090.00615.65
7.1.300.0080.00415.96
7.1.290.0000.01415.80
7.1.280.0070.00715.65
7.1.270.0070.00315.53
7.1.260.0030.01015.90
7.1.250.0070.00715.83
7.1.200.0090.00415.62
7.1.100.0040.00418.07
7.1.70.0120.00016.90
7.1.60.0140.01119.70
7.1.50.0120.00634.97
7.1.00.0030.07722.44
7.0.200.0060.00615.05
7.0.140.0000.07021.99
7.0.60.0130.08320.10
7.0.50.0070.08317.84
7.0.40.0070.08320.30
7.0.30.0330.04720.30
7.0.20.0070.05020.22
7.0.10.0030.05020.09
7.0.00.0100.04020.05
5.6.280.0000.07720.91
5.6.210.0030.05720.59
5.6.200.0070.03718.19
5.6.190.0000.09720.64
5.6.180.3130.03720.50
5.6.170.0300.08020.47
5.6.160.0070.04320.62
5.6.150.0270.06018.18
5.6.140.0070.05018.11
5.6.130.0030.06018.24
5.6.120.0100.03721.04
5.6.110.0100.08021.13
5.6.100.0000.04321.13
5.6.90.0100.08020.95
5.6.80.0170.06720.28
5.6.70.4430.03720.39
5.5.350.0130.08320.36
5.5.340.0000.04018.09
5.5.330.0030.07320.19
5.5.320.4000.04320.30
5.5.310.0330.07320.28
5.5.300.0100.07317.96
5.5.290.0100.07018.04
5.5.280.0070.08020.87
5.5.270.0070.05320.86
5.5.260.0070.05720.73
5.5.250.0130.07720.58
5.5.240.0300.06320.14
5.4.450.0530.04028.29
5.4.440.0400.03028.29
5.4.430.0470.04328.28
5.4.420.0670.04028.27
5.4.410.0700.03728.28
5.4.400.0230.04728.28
5.4.390.0230.03328.25
5.4.380.0200.05018.78
5.4.370.0100.05318.44
5.4.360.0270.06018.72
5.4.350.0100.05718.80
5.4.340.0100.05318.74
5.4.320.0110.04112.48
5.4.310.0080.04312.48
5.4.300.0080.04112.48
5.4.290.0060.04012.48
5.4.280.0080.03612.38
5.4.270.0070.03912.38
5.4.260.0100.03512.38
5.4.250.0080.03712.38
5.4.240.0050.03612.38
5.4.230.0050.04012.37
5.4.220.0050.03712.37
5.4.210.0040.03712.37
5.4.200.0070.03612.37
5.4.190.0050.03712.36
5.4.180.0060.03912.37
5.4.170.0030.04012.38
5.4.160.0050.03712.37
5.4.150.0060.04312.37
5.4.140.0070.03612.05
5.4.130.0050.03612.04
5.4.120.0060.03512.00
5.4.110.0080.03711.99
5.4.100.0090.04611.99
5.4.90.0070.04511.99
5.4.80.0080.04111.99
5.4.70.0040.03711.99
5.4.60.0040.04112.00
5.4.50.0060.03611.99
5.4.40.0070.03611.98
5.4.30.0080.03511.98
5.4.20.0060.03611.98
5.4.10.0060.03611.98
5.4.00.0100.03211.47
5.3.290.0070.04212.80
5.3.280.0070.03712.71
5.3.270.0120.03712.72
5.3.260.0050.04512.72
5.3.250.0080.03812.72
5.3.240.0050.03912.72
5.3.230.0070.03612.71
5.3.220.0030.04012.68
5.3.210.0060.03812.68
5.3.200.0060.03612.68
5.3.190.0050.03812.67
5.3.180.0030.03912.68
5.3.170.0040.03712.66
5.3.160.0050.03712.67
5.3.150.0060.03612.68
5.3.140.0060.03812.66
5.3.130.0080.03612.66
5.3.120.0020.04412.66
5.3.110.0040.04012.65
5.3.100.0030.04012.12
5.3.90.0060.03512.09
5.3.80.0100.03112.08
5.3.70.0060.03712.08
5.3.60.0070.03812.06
5.3.50.0060.03612.01
5.3.40.0050.03712.01
5.3.30.0080.03211.97
5.3.20.0030.04311.75
5.3.10.0070.03511.72
5.3.00.0030.03811.71
5.2.170.0050.0319.20
5.2.160.0070.0309.20
5.2.150.0060.0319.20
5.2.140.0080.0309.20
5.2.130.0070.0279.16
5.2.120.0070.0309.16
5.2.110.0020.0319.17
5.2.100.0040.0399.17
5.2.90.0070.0339.16
5.2.80.0060.0349.16
5.2.70.0060.0319.16
5.2.60.0040.0309.11
5.2.50.0050.0349.08
5.2.40.0070.0299.06
5.2.30.0070.0339.04
5.2.20.0040.0329.02
5.2.10.0040.0358.94
5.2.00.0020.0338.80
5.1.60.0040.0258.06
5.1.50.0060.0258.06
5.1.40.0020.0278.04
5.1.30.0000.0328.39
5.1.20.0020.0298.41
5.1.10.0070.0238.14
5.1.00.0050.0258.14
5.0.50.0030.0226.62
5.0.40.0050.0256.48
5.0.30.0020.0336.29
5.0.20.0060.0216.26
5.0.10.0050.0276.24
5.0.00.0030.0306.23
4.4.90.0040.0184.78
4.4.80.0020.0234.75
4.4.70.0020.0174.75
4.4.60.0050.0154.75
4.4.50.0020.0174.77
4.4.40.0030.0254.71
4.4.30.0020.0174.76
4.4.20.0040.0144.85
4.4.10.0020.0194.85
4.4.00.0040.0244.76
4.3.110.0020.0234.67
4.3.100.0040.0144.66
4.3.90.0010.0164.64
4.3.80.0030.0304.59
4.3.70.0040.0144.63
4.3.60.0040.0164.63
4.3.50.0030.0184.63
4.3.40.0030.0234.53
4.3.30.0030.0173.28
4.3.20.0020.0183.26
4.3.10.0050.0173.22
4.3.00.0030.02028.05

preferences:
38.49 ms | 400 KiB | 5 Q