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 (current($array1)!==false) { $current = current($array1); $key = key($array1); echo "$key => $current\n"; if ($current < 3) { $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.0140.00718.30
8.3.50.0100.01016.20
8.3.40.0120.00618.97
8.3.30.0130.00318.54
8.3.20.0040.00421.88
8.3.10.0050.00223.53
8.3.00.0050.00322.09
8.2.180.0060.00916.63
8.2.170.0130.00722.96
8.2.160.0070.00719.18
8.2.150.0000.00824.18
8.2.140.0030.00524.66
8.2.130.0040.00419.20
8.2.120.0080.00026.35
8.2.110.0050.00520.52
8.2.100.0060.00617.91
8.2.90.0030.00519.17
8.2.80.0000.00817.97
8.2.70.0040.00417.93
8.2.60.0060.00317.75
8.2.50.0080.00018.16
8.2.40.0070.00020.60
8.2.30.0040.00422.35
8.2.20.0000.00718.14
8.2.10.0040.00418.11
8.2.00.0000.00718.13
8.1.280.0100.00325.92
8.1.270.0070.00022.14
8.1.260.0000.00826.35
8.1.250.0070.00028.09
8.1.240.0060.00320.90
8.1.230.0040.00717.70
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0060.00317.36
8.1.190.0080.00017.23
8.1.180.0030.00518.10
8.1.170.0060.00318.57
8.1.160.0040.00418.92
8.1.150.0030.00320.19
8.1.140.0000.00817.48
8.1.130.0000.00718.96
8.1.120.0030.00317.39
8.1.110.0060.00317.36
8.1.100.0000.00717.28
8.1.90.0040.00417.40
8.1.80.0000.00817.34
8.1.70.0040.00417.25
8.1.60.0000.00817.55
8.1.50.0030.00617.35
8.1.40.0040.00417.36
8.1.30.0000.00817.56
8.1.20.0000.00817.55
8.1.10.0040.00417.61
8.1.00.0000.00817.39
8.0.300.0000.00818.77
8.0.290.0040.00416.63
8.0.280.0030.00318.43
8.0.270.0030.00317.25
8.0.260.0030.00316.84
8.0.250.0000.00716.83
8.0.240.0000.00916.95
8.0.230.0020.00516.85
8.0.220.0030.00316.85
8.0.210.0030.00316.82
8.0.200.0060.00316.80
8.0.190.0000.00816.83
8.0.180.0040.00416.82
8.0.170.0000.00916.90
8.0.160.0030.00416.84
8.0.150.0090.00016.82
8.0.140.0040.00416.87
8.0.130.0000.00513.37
8.0.120.0040.00416.84
8.0.110.0000.00716.70
8.0.100.0000.00716.77
8.0.90.0080.00016.68
8.0.80.0160.00616.80
8.0.70.0000.00716.68
8.0.60.0030.00516.66
8.0.50.0040.00416.88
8.0.30.0080.01017.09
8.0.20.0060.01217.40
8.0.10.0040.00416.79
8.0.00.0060.01216.55
7.4.330.0060.00015.55
7.4.320.0050.00216.42
7.4.300.0030.00316.44
7.4.290.0030.00316.60
7.4.280.0000.00816.54
7.4.270.0070.00016.64
7.4.260.0070.00016.58
7.4.250.0050.00316.50
7.4.240.0080.00016.51
7.4.230.0070.00016.57
7.4.220.0000.00916.39
7.4.210.0040.01116.58
7.4.200.0070.00016.38
7.4.160.0070.00816.46
7.4.140.0080.01017.86
7.4.130.0100.00716.38
7.4.120.0100.00816.53
7.4.110.0170.00016.56
7.4.100.0070.01016.41
7.4.90.0190.00316.50
7.4.80.0070.01319.39
7.4.70.0090.00616.45
7.4.60.0070.01116.52
7.4.50.0110.00316.36
7.4.40.0130.01016.62
7.4.00.0100.00315.12
7.3.330.0000.00713.08
7.3.320.0060.00013.07
7.3.310.0000.00716.21
7.3.300.0030.00316.35
7.3.290.0060.01116.27
7.3.280.0080.00916.30
7.3.260.0040.01416.42
7.3.240.0120.00916.36
7.3.230.0100.00716.38
7.3.210.0070.01016.52
7.3.200.0100.01016.32
7.3.190.0100.00716.40
7.3.180.0130.00316.33
7.3.170.0060.00916.31
7.3.160.0030.01316.41
7.3.10.0120.00016.61
7.3.00.0070.00716.64
7.2.330.0150.00316.37
7.2.320.0190.00316.57
7.2.310.0070.01116.44
7.2.300.0090.00616.51
7.2.290.0100.00716.88
7.2.130.0090.00616.98
7.2.120.0070.01017.05
7.2.110.0060.01117.07
7.2.100.0030.01416.96
7.2.90.0110.00416.85
7.2.80.0070.00716.96
7.2.70.0040.01216.81
7.2.60.0100.00417.05
7.2.50.0040.00816.91
7.2.40.0090.00617.00
7.2.30.0140.01017.42
7.2.20.0110.01317.16
7.2.10.0120.00917.30
7.2.00.0100.01317.33
7.1.250.0000.01115.65
7.1.200.0000.01115.52
7.1.150.0130.01016.57
7.1.140.0080.01316.61
7.1.130.0090.01316.75
7.1.120.0140.01516.43
7.1.110.0150.01315.94
7.1.100.0200.01016.32
7.1.90.0150.00915.88
7.1.80.0150.01016.02
7.1.70.0120.01215.06
7.1.60.0330.01833.28
7.1.50.0350.01533.05
7.1.40.0440.01432.67
7.1.30.0310.01732.69
7.1.20.0390.01432.71
7.1.10.0100.00914.70
7.1.00.0150.00814.83

preferences:
56.63 ms | 401 KiB | 5 Q