3v4l.org

run code in 300+ PHP versions simultaneously
<?php function has_next($array) { return next($array) === false && key($array) === null ? false : true; } $array1 = [ "one" => 1, "two" => 2, "three" => 3, "four" => 4 ]; while (has_next($array1)) { $current = current($array1); $key = key($array1); echo "$key => $current\n"; if ($current < 2) { $array1[$key] = ++$current; } else { next($array1); } }

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.0080.00818.43
8.3.50.0170.00316.50
8.3.40.0090.00618.66
8.3.30.0170.00318.63
8.3.20.0040.00421.71
8.3.10.0040.00423.54
8.3.00.0040.00422.09
8.2.180.0090.00618.16
8.2.170.0120.00322.96
8.2.160.0030.01019.21
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0070.00019.16
8.2.120.0070.00026.35
8.2.110.0070.00320.49
8.2.100.0040.00717.84
8.2.90.0050.00319.88
8.2.80.0040.00418.16
8.2.70.0060.00318.05
8.2.60.0030.00617.63
8.2.50.0080.00018.22
8.2.40.0000.00820.68
8.2.30.0070.00020.57
8.2.20.0040.00418.10
8.2.10.0000.00718.08
8.2.00.0040.00417.98
8.1.280.0040.01925.92
8.1.270.0050.00322.05
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00620.68
8.1.230.0110.00020.96
8.1.220.0000.00817.74
8.1.210.0030.00518.79
8.1.200.0000.00917.48
8.1.190.0030.00617.22
8.1.180.0000.00818.10
8.1.170.0030.00618.58
8.1.160.0070.00018.88
8.1.150.0000.00720.32
8.1.140.0070.00017.70
8.1.130.0000.00718.93
8.1.120.0040.00317.48
8.1.110.0040.00417.39
8.1.100.0000.00717.43
8.1.90.0000.00817.44
8.1.80.0000.00817.48
8.1.70.0040.00417.42
8.1.60.0060.00317.58
8.1.50.0040.00417.56
8.1.40.0070.00017.51
8.1.30.0040.00417.61
8.1.20.0040.00417.70
8.1.10.0040.00417.61
8.1.00.0000.00817.55
8.0.300.0000.00719.88
8.0.290.0090.00016.75
8.0.280.0000.00718.48
8.0.270.0030.00317.18
8.0.260.0060.00016.75
8.0.250.0000.00716.85
8.0.240.0060.00316.82
8.0.230.0070.00016.93
8.0.220.0050.00216.92
8.0.210.0000.00816.95
8.0.200.0000.01016.95
8.0.190.0000.00816.96
8.0.180.0030.00616.93
8.0.170.0060.00316.86
8.0.160.0000.00716.85
8.0.150.0050.00316.82
8.0.140.0100.00016.86
8.0.130.0000.00513.32
8.0.120.0000.00716.86
8.0.110.0000.00816.95
8.0.100.0000.00716.93
8.0.90.0040.00416.77
8.0.80.0130.00316.87
8.0.70.0040.00416.91
8.0.60.0070.00016.77
8.0.50.0070.00016.90
8.0.30.0130.00617.06
8.0.20.0140.00417.40
8.0.10.0040.00416.96
8.0.00.0100.00716.71
7.4.330.0060.00015.55
7.4.320.0000.00616.52
7.4.300.0030.00316.57
7.4.290.0000.00716.45
7.4.280.0000.00816.40
7.4.270.0000.00716.52
7.4.260.0030.00316.57
7.4.250.0000.00716.49
7.4.240.0050.00316.59
7.4.230.0030.00316.51
7.4.220.0030.00316.71
7.4.210.0060.00916.58
7.4.200.0000.00816.25
7.4.160.0080.01216.63
7.4.140.0110.01217.86
7.4.130.0170.00916.66
7.4.120.0100.00816.53
7.4.110.0060.01216.44
7.4.100.0100.00616.57
7.4.90.0090.00816.64
7.4.80.0090.01519.39
7.4.70.0130.00316.52
7.4.60.0110.00416.43
7.4.50.0030.01316.66
7.4.40.0100.00716.54
7.4.00.0100.00714.73
7.3.330.0030.00313.46
7.3.320.0000.00713.38
7.3.310.0000.00716.40
7.3.300.0030.00316.24
7.3.290.0120.00716.37
7.3.280.0100.00416.37
7.3.260.0120.00616.48
7.3.240.0100.00816.49
7.3.230.0120.00616.51
7.3.210.0110.00716.35
7.3.200.0060.01116.42
7.3.190.0070.01016.27
7.3.180.0110.00516.46
7.3.170.0100.00616.57
7.3.160.0120.00916.38
7.2.330.0110.01516.78
7.2.320.0090.00916.75
7.2.310.0080.00816.38
7.2.300.0140.00316.48
7.2.290.0060.01216.81
7.2.60.0000.00817.07
7.2.30.0270.01317.64
7.2.20.0360.01417.77
7.2.10.0210.01517.95
7.2.00.0130.01718.00
7.1.200.0000.01115.89
7.1.150.0170.01416.56
7.1.140.0180.01816.57
7.1.130.0190.01316.69
7.1.120.0200.01316.64
7.1.110.0250.01015.94
7.1.100.0930.01416.01
7.1.90.0190.01215.90
7.1.80.0160.01415.82
7.1.70.0130.01615.29
7.1.60.0380.01333.20
7.1.50.0340.01132.93
7.1.40.0310.01532.84
7.1.30.0400.02132.66
7.1.20.0330.02232.68
7.1.10.0130.01214.73
7.1.00.0490.03014.63

preferences:
65.2 ms | 400 KiB | 5 Q