3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = Array ( 0 => 0, 1 => 1, 2 => 8, 3 => 0, 4 => 0, 5 => 0, 6 => 0, 7 => 0, 8 => 0, 10 => 0, 11 => 0, 12 => 0, 14 => 0, 15 => 0, ); $keys = array_keys($array); $oldK = 0; while(current($keys) !== false){ $key = current($keys); if($key === $oldK) next($keys); else $array[$oldK] = 999; $oldK++; } ksort($array); 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.5.10.0100.00818.96
8.5.00.0070.00419.90
8.4.160.0110.01124.01
8.4.150.0020.00114.05
8.4.140.0150.00517.82
8.4.130.0110.00918.67
8.4.120.0130.00724.35
8.4.110.0140.00620.71
8.4.100.0160.00517.88
8.4.90.0040.00419.37
8.4.80.0090.01119.45
8.4.70.0100.01117.90
8.4.60.0120.00520.21
8.4.50.0080.00817.76
8.4.40.0090.00017.59
8.4.30.0040.00420.35
8.4.20.0140.00717.68
8.4.10.0060.00319.38
8.3.280.0100.01018.28
8.3.270.0120.00816.45
8.3.260.0120.00816.34
8.3.250.0090.00918.75
8.3.240.0130.00616.95
8.3.230.0140.00516.54
8.3.220.0050.00318.86
8.3.210.0100.00916.53
8.3.200.0040.00516.54
8.3.190.0100.00517.16
8.3.180.0170.00618.51
8.3.170.0000.00916.68
8.3.160.0100.00718.07
8.3.150.0120.00617.29
8.3.140.0080.01118.57
8.3.130.0030.00518.11
8.3.120.0000.01118.98
8.3.110.0030.00620.94
8.3.100.0090.00024.06
8.3.90.0090.00026.77
8.3.80.0060.00316.63
8.3.70.0070.00718.18
8.3.60.0070.01418.30
8.3.50.0050.01023.68
8.3.40.0150.00018.71
8.3.30.0140.00018.84
8.3.20.0040.00420.88
8.3.10.0090.00023.66
8.3.00.0080.00019.68
8.2.290.0080.00620.36
8.2.280.0100.00818.17
8.2.270.0110.00716.44
8.2.260.0180.00018.78
8.2.250.0070.01118.55
8.2.240.0090.00618.85
8.2.230.0040.00422.58
8.2.220.0030.00637.54
8.2.210.0080.00026.77
8.2.200.0090.00016.38
8.2.190.0070.01018.29
8.2.180.0150.00018.41
8.2.170.0120.00322.96
8.2.160.0070.00721.10
8.2.150.0050.00324.18
8.2.140.0070.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00426.16
8.2.110.0080.00322.25
8.2.100.0090.00317.66
8.2.90.0040.00419.05
8.2.80.0050.00318.16
8.2.70.0030.00617.73
8.2.60.0060.00317.93
8.2.50.0000.00818.10
8.2.40.0000.00819.82
8.2.30.0030.00319.42
8.2.20.0040.00417.99
8.2.10.0040.00419.19
8.2.00.0000.00719.25
8.1.330.0100.00921.92
8.1.320.0140.00816.21
8.1.310.0040.00416.63
8.1.300.0070.00318.03
8.1.290.0060.00318.88
8.1.280.0120.00925.92
8.1.270.0080.00020.60
8.1.260.0040.00426.35
8.1.250.0060.00328.09
8.1.240.0050.00522.19
8.1.230.0110.00017.83
8.1.220.0030.00517.78
8.1.210.0040.00418.77
8.1.200.0090.00017.35
8.1.190.0040.00417.10
8.1.180.0030.00518.10
8.1.170.0040.00417.62
8.1.160.0040.00418.82
8.1.150.0050.00318.88
8.1.140.0000.00720.64
8.1.130.0040.00417.30
8.1.120.0040.00417.46
8.1.110.0040.00417.38
8.1.100.0000.00917.45
8.1.90.0050.00317.40
8.1.80.0040.00417.34
8.1.70.0070.00017.28
8.1.60.0000.00817.43
8.1.50.0050.00217.48
8.1.40.0080.00017.39
8.1.30.0000.00817.58
8.1.20.0000.00817.48
8.1.10.0000.00717.44
8.1.00.0000.00817.55
8.0.300.0050.00218.77
8.0.290.0080.00516.58
8.0.280.0030.00318.33
8.0.270.0000.00717.84
8.0.260.0030.00316.75
8.0.250.0030.00316.78
8.0.240.0000.00616.74
8.0.230.0010.00616.81
8.0.220.0000.00716.87
8.0.210.0000.00716.79
8.0.200.0040.00416.86
8.0.190.0070.00016.79
8.0.180.0080.00016.77
8.0.170.0030.00616.84
8.0.160.0040.00416.72
8.0.150.0000.00716.77
8.0.140.0030.00316.71
8.0.130.0050.00013.18
8.0.120.0020.00516.70
8.0.110.0000.00716.71
8.0.100.0050.00216.60
8.0.90.0030.00616.71
8.0.80.0060.01316.79
8.0.70.0000.00716.82
8.0.60.0050.00316.65
8.0.50.0040.00416.61
8.0.30.0090.00917.36
8.0.20.0110.00816.67
8.0.10.0000.00916.86
8.0.00.0040.01516.73
7.4.330.0000.00516.83
7.4.320.0000.00616.63
7.4.300.0000.00616.54
7.4.290.0030.00316.48
7.4.280.0040.00416.59
7.4.270.0030.00516.51
7.4.260.0030.00313.29
7.4.250.0060.00316.48
7.4.240.0030.00316.54
7.4.230.0000.00716.61
7.4.220.0030.00416.53
7.4.210.0070.00916.54
7.4.200.0030.00316.61
7.4.130.0100.00716.55
7.4.120.0090.01416.34
7.4.110.0040.01316.48
7.4.100.0090.00616.63
7.4.90.0150.00316.38
7.4.80.0160.00619.39
7.4.70.0100.00716.43
7.4.60.0070.01116.63
7.4.50.0110.00716.26
7.4.40.0090.00916.54
7.4.20.0130.00816.22
7.4.10.0090.00916.13
7.4.00.0160.00316.32
7.3.330.0050.00316.37
7.3.320.0060.00013.23
7.3.310.0030.00316.39
7.3.300.0070.00016.30
7.3.290.0110.00716.37
7.3.280.0120.00316.15
7.3.260.0080.01116.66
7.3.240.0120.00516.39
7.3.230.0170.00016.46
7.3.210.0120.00616.25
7.3.200.0000.01716.39
7.3.190.0110.00516.21
7.3.180.0090.00616.56
7.3.170.0120.01016.54
7.3.160.0060.01016.32
7.3.140.0080.01116.27
7.3.130.0030.01316.48
7.3.120.0090.00916.15
7.3.110.0040.01616.38
7.3.100.0080.00816.23
7.3.90.0060.01216.21
7.3.80.0160.00516.38
7.3.70.0040.01516.22
7.3.60.0100.00716.09
7.3.50.0030.01516.26
7.3.40.0110.01116.24
7.3.30.0140.00516.25
7.3.20.0080.01516.25
7.3.10.0070.01416.42
7.3.00.0110.01216.43
7.2.330.0090.00916.56
7.2.320.0100.00716.41
7.2.310.0100.01016.51
7.2.300.0070.01016.77
7.2.290.0130.00916.63
7.2.270.0090.00916.54
7.2.260.0180.00016.37
7.2.250.0140.00716.52
7.2.240.0130.00516.57
7.2.230.0100.01016.68
7.2.220.0150.00916.56
7.2.210.0070.01416.10
7.2.200.0100.00716.10
7.2.190.0130.01316.42
7.2.180.0060.01216.43
7.2.170.0170.00316.41
7.2.160.0070.01016.36
7.2.150.0160.00616.50
7.2.140.0120.01216.54
7.2.130.0100.01316.38
7.2.120.0100.01316.52
7.2.110.0060.01616.42
7.2.100.0070.01016.54
7.2.90.0120.00616.43
7.2.80.0090.00916.59
7.2.70.0180.00016.57
7.2.60.0100.00716.61
7.2.50.0100.00716.42
7.2.40.0070.01016.65
7.2.30.0130.00716.61
7.2.20.0090.00916.47
7.2.10.0090.00916.49
7.2.00.0090.01316.57

preferences:
36.22 ms | 403 KiB | 5 Q