3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( 0 => 'string1', 2 => 'string5', 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.0100.00716.75
8.3.50.0120.00522.00
8.3.40.0120.00618.70
8.3.30.0070.00718.95
8.3.20.0000.00720.34
8.3.10.0040.00423.57
8.3.00.0040.00422.58
8.2.180.0070.00716.50
8.2.170.0150.00322.96
8.2.160.0070.00720.20
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0150.00426.16
8.2.120.0040.00422.25
8.2.110.0070.00322.26
8.2.100.0000.01217.72
8.2.90.0080.00019.18
8.2.80.0030.00517.97
8.2.70.0050.00317.59
8.2.60.0000.00818.03
8.2.50.0030.00618.07
8.2.40.0040.00418.34
8.2.30.0000.00718.11
8.2.20.0000.00817.71
8.2.10.0080.00019.52
8.2.00.0030.00617.73
8.1.280.0100.00725.92
8.1.270.0000.00823.77
8.1.260.0080.00026.35
8.1.250.0050.00328.09
8.1.240.0060.00323.96
8.1.230.0110.00019.20
8.1.220.0060.00317.74
8.1.210.0060.00318.77
8.1.200.0060.00317.35
8.1.190.0050.00317.55
8.1.180.0040.00418.10
8.1.170.0030.00518.63
8.1.160.0000.00722.08
8.1.150.0040.00418.55
8.1.140.0020.00517.56
8.1.130.0040.00417.87
8.1.120.0000.00717.36
8.1.110.0000.00717.48
8.1.100.0040.00417.47
8.1.90.0030.00417.41
8.1.80.0000.00717.41
8.1.70.0000.00717.46
8.1.60.0040.00417.60
8.1.50.0030.00517.42
8.1.40.0040.00417.55
8.1.30.0000.00817.60
8.1.20.0040.00417.62
8.1.10.0000.00817.50
8.1.00.0050.00217.41
8.0.300.0000.00718.77
8.0.290.0000.00717.30
8.0.280.0000.00718.45
8.0.270.0030.00617.27
8.0.260.0000.00616.73
8.0.250.0000.00616.97
8.0.240.0040.00416.98
8.0.230.0070.00016.86
8.0.220.0040.00416.88
8.0.210.0030.00316.91
8.0.200.0050.00216.84
8.0.190.0030.00316.96
8.0.180.0070.00016.80
8.0.170.0040.00416.81
8.0.160.0030.00316.86
8.0.150.0040.00416.89
8.0.140.0070.00016.78
8.0.130.0030.00313.36
8.0.120.0050.00316.87
8.0.110.0070.00016.91
8.0.100.0040.00416.79
8.0.90.0050.00316.80
8.0.80.0070.01116.92
8.0.70.0040.00416.84
8.0.60.0000.00716.85
8.0.50.0040.00416.67
8.0.30.0130.00517.13
8.0.20.0110.00817.40
8.0.10.0080.00017.01
8.0.00.0130.00716.73
7.4.330.0050.00015.05
7.4.320.0000.00616.51
7.4.300.0000.00616.43
7.4.290.0030.00316.59
7.4.280.0070.00016.45
7.4.270.0030.00316.49
7.4.260.0000.00716.50
7.4.250.0080.00016.59
7.4.240.0050.00216.50
7.4.230.0000.00716.69
7.4.220.0030.01416.64
7.4.210.0090.00916.51
7.4.200.0000.00716.36
7.4.190.0070.00016.59
7.4.160.0030.01316.45
7.4.150.0140.00317.40
7.4.140.0130.00817.86
7.4.130.0080.00816.58
7.4.120.0130.00716.39
7.4.110.0190.00416.54
7.4.100.0130.00616.63
7.4.90.0100.00716.48
7.4.80.0080.00819.39
7.4.70.0140.00416.44
7.4.60.0150.00316.61
7.4.50.0050.00016.53
7.4.40.0060.00922.77
7.4.30.0120.00316.44
7.4.00.0030.01314.90
7.3.330.0030.00313.22
7.3.320.0030.00313.18
7.3.310.0030.00316.40
7.3.300.0030.00316.25
7.3.290.0110.00716.29
7.3.280.0090.00716.29
7.3.270.0180.00417.40
7.3.260.0150.00716.32
7.3.250.0170.00016.49
7.3.240.0100.00616.22
7.3.230.0100.00616.39
7.3.210.0130.00316.28
7.3.200.0060.01519.39
7.3.190.0030.01516.48
7.3.180.0070.01016.32
7.3.170.0130.00316.63
7.3.160.0100.00616.59
7.3.120.0100.00314.82
7.3.10.0060.00616.64
7.3.00.0110.00316.55
7.2.330.0080.00816.80
7.2.320.0090.00916.62
7.2.310.0100.01316.66
7.2.300.0100.00716.68
7.2.290.0100.00616.64
7.2.130.0040.00816.76
7.2.120.0040.00816.78
7.2.110.0030.00916.96
7.2.100.0120.00316.73
7.2.90.0030.00916.76
7.2.80.0060.00316.94
7.2.70.0060.00616.99
7.2.60.0000.01616.98
7.2.50.0100.00317.00
7.2.40.0070.01016.84
7.2.30.0100.00317.07
7.2.20.0040.00717.04
7.2.10.0030.01016.87
7.2.00.0020.00818.15
7.1.250.0040.00715.65
7.1.100.0040.01117.92
7.1.70.0030.00517.15
7.1.60.0100.01019.29
7.1.50.0070.01416.98
7.1.00.0070.07322.33
7.0.200.0070.01016.86
7.0.140.0000.07322.18
7.0.60.0070.07319.89
7.0.50.0070.04717.85
7.0.40.0000.06320.18
7.0.30.0300.08320.06
7.0.20.0170.04320.09
7.0.10.0200.04320.07
7.0.00.0130.04720.07
5.6.280.0070.07021.02
5.6.210.0070.06020.74
5.6.200.0070.03718.28
5.6.190.0030.04320.41
5.6.180.0030.07320.63
5.6.170.0300.07320.39
5.6.160.0100.06720.56
5.6.150.0070.06718.14
5.6.140.0070.04018.22
5.6.130.0000.05018.18
5.6.120.0000.04321.14
5.6.110.0100.03320.97
5.6.100.0030.06321.14
5.6.90.0030.08320.97
5.6.80.0070.06720.50
5.6.70.0330.07020.36
5.5.350.0000.08320.35
5.5.340.0070.08017.94
5.5.330.0130.08020.19
5.5.320.0100.04720.19
5.5.310.0300.07720.19
5.5.300.0100.05717.98
5.5.290.0100.04718.08
5.5.280.0070.04720.96
5.5.270.0230.07320.87
5.5.260.0030.04020.86
5.5.250.0030.07020.46
5.5.240.0070.07720.28
5.4.450.1170.04019.55
5.4.440.0800.05319.45
5.4.430.0170.05019.60
5.4.420.0600.05719.16
5.4.410.0700.04719.34
5.4.400.0900.06018.87
5.4.390.0600.05019.30
5.4.380.0070.06018.79
5.4.370.0100.06318.62
5.4.360.0130.05318.75
5.4.350.0270.04318.79
5.4.340.0200.04718.62
5.4.320.0100.03212.48
5.4.310.0080.04512.48
5.4.300.0050.04212.49
5.4.290.0040.03912.48
5.4.280.0150.09012.34
5.4.270.0060.04912.35
5.4.260.0130.06812.35
5.4.250.0080.05712.35
5.4.240.0080.05312.34
5.4.230.0090.05212.34
5.4.220.0110.04812.34
5.4.210.0110.04612.34
5.4.200.0090.05112.34
5.4.190.0080.05212.33
5.4.180.0100.04812.34
5.4.170.0080.05012.35
5.4.160.0040.05012.34
5.4.150.0100.04412.34
5.4.140.0050.05312.02
5.4.130.0050.04812.01
5.4.120.0070.04911.97
5.4.110.0070.04811.96
5.4.100.0040.04811.96
5.4.90.0060.05011.96
5.4.80.0080.04911.96
5.4.70.0020.05211.96
5.4.60.0050.04811.96
5.4.50.0090.04711.96
5.4.40.0110.04411.95
5.4.30.0070.04711.95
5.4.20.0070.04911.95
5.4.10.0090.04511.95
5.4.00.0030.05211.44
5.3.290.0060.03912.80
5.3.280.0070.04912.71
5.3.270.0090.05112.72
5.3.260.0140.05012.72
5.3.250.0100.04912.72
5.3.240.0080.05012.72
5.3.230.0110.04512.70
5.3.220.0080.05212.68
5.3.210.0110.04912.68
5.3.200.0100.04912.68
5.3.190.0060.04812.68
5.3.180.0110.04612.67
5.3.170.0100.04912.67
5.3.160.0070.05112.67
5.3.150.0080.05412.68
5.3.140.0070.05412.66
5.3.130.0070.05212.66
5.3.120.0140.05212.66
5.3.110.0120.05112.66
5.3.100.0100.04512.11
5.3.90.0060.04712.08
5.3.80.0100.04412.07
5.3.70.0080.04512.08
5.3.60.0070.05112.06
5.3.50.0100.05212.00
5.3.40.0090.04612.00
5.3.30.0100.04911.94
5.3.20.0110.04811.72
5.3.10.0080.04711.69
5.3.00.0110.03911.68
5.2.170.0050.0409.18
5.2.160.0090.0309.17
5.2.150.0060.0389.18
5.2.140.0090.0389.17
5.2.130.0060.0369.13
5.2.120.0060.0299.13
5.2.110.0030.0329.14
5.2.100.0040.0319.14
5.2.90.0040.0319.13
5.2.80.0060.0309.14
5.2.70.0060.0329.13
5.2.60.0030.0339.08
5.2.50.0050.0299.05
5.2.40.0040.0309.03
5.2.30.0030.0339.01
5.2.20.0060.0278.99
5.2.10.0050.0288.91
5.2.00.0050.0288.77
5.1.60.0050.0238.05
5.1.50.0050.0258.05
5.1.40.0070.0238.02
5.1.30.0070.0418.38
5.1.20.0080.0358.40
5.1.10.0060.0348.13
5.1.00.0040.0288.13
5.0.50.0020.0266.60
5.0.40.0030.0206.46
5.0.30.0030.0326.27
5.0.20.0050.0186.25
5.0.10.0040.0206.22
5.0.00.0060.0296.21
4.4.90.0040.0164.78
4.4.80.0050.0134.75
4.4.70.0030.0154.75
4.4.60.0040.0154.76
4.4.50.0020.0184.77
4.4.40.0050.0254.71
4.4.30.0020.0194.76
4.4.20.0040.0164.85
4.4.10.0030.0164.84
4.4.00.0030.0284.76
4.3.110.0040.0154.67
4.3.100.0050.0194.67
4.3.90.0030.0164.64
4.3.80.0050.0314.58
4.3.70.0060.0244.63
4.3.60.0030.0244.62
4.3.50.0050.0154.63
4.3.40.0030.0334.54
4.3.30.0010.0243.28
4.3.20.0070.0363.26
4.3.10.0080.0423.22
4.3.00.0170.01313.43

preferences:
40.39 ms | 401 KiB | 5 Q