3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( 0 => 'string1', 2 => 'string2', 9 => '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.50
8.3.50.0120.00922.12
8.3.40.0090.00618.77
8.3.30.0030.01019.09
8.3.20.0040.00420.38
8.3.10.0080.00023.48
8.3.00.0080.00019.26
8.2.180.0090.00616.63
8.2.170.0110.00322.96
8.2.160.0140.00020.48
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0040.00422.08
8.2.110.0060.00322.26
8.2.100.0060.00617.72
8.2.90.0040.00419.34
8.2.80.0000.00817.97
8.2.70.0000.00917.63
8.2.60.0030.00617.93
8.2.50.0040.00418.07
8.2.40.0040.00419.94
8.2.30.0020.00518.13
8.2.20.0040.00417.76
8.2.10.0050.00318.12
8.2.00.0070.00017.81
8.1.280.0140.00325.92
8.1.270.0050.00322.19
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0080.00023.90
8.1.230.0070.00419.09
8.1.220.0000.00817.79
8.1.210.0000.00818.77
8.1.200.0030.00617.36
8.1.190.0030.00617.22
8.1.180.0040.00419.01
8.1.170.0040.00418.41
8.1.160.0040.00421.92
8.1.150.0030.00518.64
8.1.140.0000.00717.50
8.1.130.0030.00317.82
8.1.120.0040.00417.49
8.1.110.0040.00417.44
8.1.100.0000.00717.45
8.1.90.0050.00217.50
8.1.80.0040.00417.34
8.1.70.0040.00417.42
8.1.60.0070.00017.60
8.1.50.0080.00017.52
8.1.40.0060.00317.41
8.1.30.0000.00817.48
8.1.20.0080.00017.50
8.1.10.0070.00017.50
8.1.00.0040.00417.34
8.0.300.0070.00018.77
8.0.290.0040.00417.05
8.0.280.0040.00418.49
8.0.270.0000.00717.27
8.0.260.0000.00617.17
8.0.250.0000.00716.93
8.0.240.0030.00316.88
8.0.230.0030.00316.95
8.0.220.0030.00316.83
8.0.210.0070.00016.79
8.0.200.0060.00017.00
8.0.190.0030.00616.93
8.0.180.0050.00216.82
8.0.170.0000.00816.80
8.0.160.0030.00316.90
8.0.150.0040.00416.83
8.0.140.0050.00216.81
8.0.130.0030.00313.30
8.0.120.0030.00516.82
8.0.110.0040.00416.79
8.0.100.0070.00016.68
8.0.90.0040.00416.79
8.0.80.0000.01416.85
8.0.70.0030.00517.02
8.0.60.0080.00016.92
8.0.50.0040.00416.77
8.0.30.0080.01117.21
8.0.20.0120.00617.40
8.0.10.0000.00716.85
8.0.00.0070.01316.78
7.4.330.0070.00015.00
7.4.320.0030.00316.58
7.4.300.0030.00316.56
7.4.290.0040.00416.52
7.4.280.0110.00016.61
7.4.270.0070.00016.52
7.4.260.0000.00716.58
7.4.250.0070.00016.46
7.4.240.0030.00416.51
7.4.230.0000.00716.69
7.4.220.0120.00616.46
7.4.210.0070.00716.58
7.4.200.0030.00316.58
7.4.190.0030.00316.48
7.4.160.0060.01016.67
7.4.150.0040.01417.40
7.4.140.0120.00817.86
7.4.130.0090.00916.54
7.4.120.0110.00616.44
7.4.110.0110.00716.39
7.4.100.0100.01116.43
7.4.90.0110.00716.60
7.4.80.0150.00319.39
7.4.70.0060.01316.50
7.4.60.0070.01016.41
7.4.50.0080.00016.48
7.4.40.0140.00316.57
7.4.30.0070.01016.54
7.4.00.0030.01015.08
7.3.330.0030.00313.10
7.3.320.0000.00513.13
7.3.310.0030.00316.40
7.3.300.0000.00716.24
7.3.290.0070.01416.40
7.3.280.0100.00916.31
7.3.270.0170.00017.40
7.3.260.0150.00316.37
7.3.250.0120.01116.55
7.3.240.0100.00716.37
7.3.230.0050.01116.62
7.3.210.0100.00716.58
7.3.200.0130.00719.39
7.3.190.0070.01016.34
7.3.180.0120.00316.49
7.3.170.0090.00616.27
7.3.160.0040.01116.44
7.3.120.0100.00315.06
7.2.330.0090.00916.63
7.2.320.0030.01316.75
7.2.310.0030.01616.53
7.2.300.0070.01016.55
7.2.290.0170.00716.71
7.2.00.0120.00818.98
7.1.100.0000.00818.19
7.1.70.0030.00617.15
7.1.60.0070.01719.46
7.1.50.0140.01016.77
7.1.00.0000.08022.36
7.0.200.0050.00516.91
7.0.140.0100.06721.96
7.0.60.0100.03319.91
7.0.50.0000.05017.98
7.0.40.0000.04720.27
7.0.30.0270.08020.12
7.0.20.0230.05020.07
7.0.10.0030.08320.09
7.0.00.0100.03720.25
5.6.280.0030.07321.07
5.6.210.0130.07320.76
5.6.200.0170.07318.15
5.6.190.0130.03720.33
5.6.180.0370.06720.33
5.6.170.0200.07720.54
5.6.160.0000.09020.44
5.6.150.0000.09018.18
5.6.140.0030.04018.23
5.6.130.0070.06718.27
5.6.120.0000.04721.12
5.6.110.0130.07721.12
5.6.100.0170.07321.02
5.6.90.0070.05021.12
5.6.80.0070.08320.37
5.5.350.0170.03320.49
5.5.340.0100.07717.98
5.5.330.0130.08020.21
5.5.320.0230.04320.34
5.5.310.0100.04320.24
5.5.300.0070.04017.98
5.5.290.0000.04318.08
5.5.280.0100.07320.80
5.5.270.0130.08020.86
5.5.260.0130.07020.79
5.5.250.0200.05320.68
5.5.240.0030.08320.18
5.4.450.0130.05019.52
5.4.440.0900.04719.20
5.4.430.0870.05019.56
5.4.420.0530.03319.38
5.4.410.1030.04319.06
5.4.400.0230.03019.15
5.4.390.0830.04319.01
5.4.380.0400.05318.64
5.4.370.0330.04718.84
5.4.360.0300.05318.82
5.4.350.0400.05018.75
5.4.340.0300.05718.55
5.4.320.0040.03812.48
5.4.310.0050.03712.48
5.4.300.0050.03712.48
5.4.290.0090.04112.48
5.4.280.0080.03612.38
5.4.270.0160.04312.38
5.4.260.0050.04412.38
5.4.250.0120.04912.38
5.4.240.0110.05112.38
5.4.230.0070.04112.37
5.4.220.0070.04012.37
5.4.210.0110.03312.37
5.4.200.0110.03612.37
5.4.190.0060.04012.36
5.4.180.0130.05212.37
5.4.170.0100.05712.38
5.4.160.0130.04612.37
5.4.150.0090.04612.37
5.4.140.0120.03712.05
5.4.130.0050.04012.04
5.4.120.0060.04512.00
5.4.110.0080.03912.00
5.4.100.0060.03812.00
5.4.90.0090.03912.00
5.4.80.0070.05012.00
5.4.70.0060.06011.99
5.4.60.0060.05411.99
5.4.50.0070.03911.99
5.4.40.0080.03711.98
5.4.30.0090.04911.98
5.4.20.0140.03511.98
5.4.10.0120.04511.98
5.4.00.0080.05411.46
5.3.290.0050.04512.80
5.3.280.0110.05212.71
5.3.270.0140.10012.73
5.3.260.0200.07512.72
5.3.250.0110.05612.72
5.3.240.0100.08812.72
5.3.230.0090.03912.70
5.3.220.0080.05512.68
5.3.210.0110.05312.68
5.3.200.0080.05612.68
5.3.190.0100.05912.68
5.3.180.0090.05312.67
5.3.170.0100.05612.67
5.3.160.0150.07112.67
5.3.150.0120.07212.67
5.3.140.0150.05512.66
5.3.130.0120.06312.65
5.3.120.0110.05112.66
5.3.110.0150.04712.66
5.3.100.0140.06712.12
5.3.90.0170.06112.09
5.3.80.0170.05412.08
5.3.70.0130.05012.08
5.3.60.0150.04312.07
5.3.50.0100.04112.01
5.3.40.0050.04212.01
5.3.30.0080.05311.97
5.3.20.0130.05811.75
5.3.10.0080.05111.71
5.3.00.0100.04711.71
5.2.170.0070.0359.20
5.2.160.0040.0379.20
5.2.150.0020.0399.21
5.2.140.0070.0379.20
5.2.130.0070.0329.16
5.2.120.0070.0349.16
5.2.110.0080.0329.17
5.2.100.0070.0329.16
5.2.90.0060.0339.16
5.2.80.0060.0389.16
5.2.70.0090.0569.16
5.2.60.0260.0549.12
5.2.50.0270.0789.09
5.2.40.0110.0359.06
5.2.30.0100.0459.04
5.2.20.0090.0499.02
5.2.10.0120.0588.94
5.2.00.0100.0488.80
5.1.60.0060.0358.06
5.1.50.0080.0318.06
5.1.40.0140.0378.04
5.1.30.0070.0378.39
5.1.20.0070.0408.41
5.1.10.0090.0348.14
5.1.00.0080.0358.14
5.0.50.0030.0306.61
5.0.40.0090.0546.47
5.0.30.0060.0526.29
5.0.20.0070.0286.25
5.0.10.0080.0356.23
5.0.00.0070.0496.23
4.4.90.0120.0334.78
4.4.80.0130.0324.76
4.4.70.0060.0194.75
4.4.60.0030.0174.75
4.4.50.0040.0194.77
4.4.40.0020.0294.71
4.4.30.0070.0204.76
4.4.20.0020.0194.85
4.4.10.0040.0164.85
4.4.00.0090.0374.76
4.3.110.0060.0174.66
4.3.100.0050.0144.66
4.3.90.0060.0124.63
4.3.80.0030.0254.58
4.3.70.0040.0154.63
4.3.60.0050.0194.63
4.3.50.0070.0334.62
4.3.40.0040.0364.54
4.3.30.0020.0203.28
4.3.20.0020.0243.26
4.3.10.0000.0253.22
4.3.00.0030.01716.16

preferences:
38.7 ms | 400 KiB | 5 Q