3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ "one" => 1, "two" => 2, "three" => 3, "four" => 4 ]; while (($key = key($array)) !== null) { // check if the internal pointer points beyond the end of the elements list or the array is empty echo "$key => {$array[$key]}\n"; // display current key value pair if ($array[$key] < 3) { // an arbitrary condition echo "\t"; ++$array[$key]; // increment the current value } else { // current value is satisfactory echo "\t(advance pointer)\n"; next($array); // move pointer } }

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.0150.00416.48
8.5.00.0120.00920.01
8.4.150.0020.00114.05
8.4.140.0140.00717.64
8.4.130.0120.00817.59
8.4.120.0130.00723.97
8.4.110.0080.00818.80
8.4.100.0040.00717.50
8.4.90.0140.00620.53
8.4.80.0040.01020.55
8.4.70.0030.00520.69
8.4.60.0110.00920.23
8.4.50.0140.00619.55
8.4.40.0100.01017.76
8.4.30.0030.00619.68
8.4.20.0120.00819.57
8.4.10.0000.00919.41
8.3.280.0130.00620.15
8.3.270.0130.00616.50
8.3.260.0080.00316.39
8.3.250.0110.00918.89
8.3.240.0120.00817.30
8.3.230.0140.00417.16
8.3.220.0080.01519.03
8.3.210.0130.00516.58
8.3.200.0040.00516.65
8.3.190.0080.00916.97
8.3.180.0130.00616.37
8.3.170.0150.00318.80
8.3.160.0160.00318.46
8.3.150.0080.00016.48
8.3.140.0100.00716.50
8.3.130.0140.00416.73
8.3.120.0040.00418.41
8.3.110.0040.00416.60
8.3.100.0060.00316.75
8.3.90.0080.00018.43
8.3.80.0060.00318.42
8.3.70.0120.00316.58
8.3.60.0130.00316.75
8.3.50.0050.01117.40
8.3.40.0120.00318.85
8.3.30.0110.00418.67
8.3.20.0000.00821.91
8.3.10.0070.00023.66
8.3.00.0070.00022.09
8.2.290.0070.00717.08
8.2.280.0110.00520.35
8.2.270.0140.00317.27
8.2.260.0030.01319.18
8.2.250.0040.00416.80
8.2.240.0040.00418.83
8.2.230.0080.00020.94
8.2.220.0100.01024.06
8.2.210.0110.00726.77
8.2.200.0090.00018.35
8.2.190.0150.00016.88
8.2.180.0110.00725.92
8.2.170.0070.01318.94
8.2.160.0090.00622.96
8.2.150.0090.00925.66
8.2.140.0060.00324.66
8.2.130.0070.00020.89
8.2.120.0040.00426.35
8.2.110.0050.00520.56
8.2.100.0030.01017.84
8.2.90.0080.00018.05
8.2.80.0080.00018.22
8.2.70.0000.01017.48
8.2.60.0080.00017.75
8.2.50.0040.00417.50
8.2.40.0040.00417.75
8.2.30.0030.00522.36
8.2.20.0040.00418.20
8.2.10.0040.00418.19
8.2.00.0070.00018.11
8.1.330.0130.00616.18
8.1.320.0110.00916.28
8.1.310.0090.00016.74
8.1.300.0060.00318.01
8.1.290.0000.01118.88
8.1.280.0070.00725.92
8.1.270.0050.00320.14
8.1.260.0070.00026.35
8.1.250.0060.00328.09
8.1.240.0060.00323.91
8.1.230.0040.00723.93
8.1.220.0040.00417.79
8.1.210.0000.00818.77
8.1.200.0060.00317.23
8.1.190.0000.00817.09
8.1.180.0030.00718.10
8.1.170.0080.00017.62
8.1.160.0080.00018.77
8.1.150.0000.00720.27
8.1.140.0000.00717.65
8.1.130.0050.00519.09
8.1.120.0030.00317.42
8.1.110.0030.00517.29
8.1.100.0040.00417.46
8.1.90.0060.00317.43
8.1.80.0070.00017.39
8.1.70.0000.00817.31
8.1.60.0040.00417.55
8.1.50.0070.00017.48
8.1.40.0000.00817.44
8.1.30.0030.00717.58
8.1.20.0040.00517.59
8.1.10.0080.00117.60
8.1.00.0050.00517.51
8.0.300.0080.00019.90
8.0.290.0000.00816.75
8.0.280.0030.00318.44
8.0.270.0000.00716.79
8.0.260.0040.00416.79
8.0.250.0000.00716.91
8.0.240.0080.00016.96
8.0.230.0030.00617.00
8.0.220.0060.00016.79
8.0.210.0030.00516.77
8.0.200.0060.00016.85
8.0.190.0030.00316.86
8.0.180.0080.00016.98
8.0.170.0070.00316.82
8.0.160.0040.00516.97
8.0.150.0060.00416.88
8.0.140.0070.00216.81
8.0.130.0050.00315.15
8.0.120.0000.00916.84
8.0.110.0050.00416.79
8.0.100.0050.00516.84
8.0.90.0060.00216.83
8.0.80.0010.01216.86
8.0.70.0040.00616.82
8.0.60.0090.00416.76
8.0.50.0070.00616.78
8.0.30.0090.00917.03
8.0.20.0130.00817.13
8.0.10.0130.00716.84
8.0.00.0120.01016.85
7.4.330.0000.00715.55
7.4.320.0070.00016.39
7.4.300.0000.00616.60
7.4.290.0030.00316.46
7.4.280.0030.00816.59
7.4.270.0070.00416.53
7.4.260.0130.00116.39
7.4.250.0140.00416.43
7.4.240.0060.00716.53
7.4.230.0100.00616.36
7.4.220.0070.00516.55
7.4.210.0100.01016.56
7.4.200.0080.00616.55
7.4.190.0160.00016.44
7.4.180.0110.00416.16
7.4.160.0090.00616.54
7.4.150.0090.01016.40
7.4.140.0110.00917.37
7.4.130.0080.00916.53
7.4.120.0100.01016.50
7.4.110.0130.00716.44
7.4.100.0110.00816.50
7.4.90.0120.00816.47
7.4.80.0150.00616.92
7.4.70.0130.00916.44
7.4.60.0130.00816.50
7.4.50.0120.00816.38
7.4.40.0130.00816.47
7.4.30.0110.00816.39
7.4.20.0120.00716.48
7.4.10.0080.01016.46
7.4.00.0110.00916.07
7.3.330.0140.00214.70
7.3.320.0100.00514.75
7.3.310.0070.00716.30
7.3.300.0140.00016.27
7.3.290.0100.00516.26
7.3.280.0090.00816.26
7.3.270.0150.00816.28
7.3.260.0130.00616.29
7.3.250.0150.00716.30
7.3.240.0140.00716.35
7.3.230.0110.00916.36
7.3.220.0080.01216.32
7.3.210.0110.01016.40
7.3.200.0120.00916.29
7.3.190.0140.00816.45
7.3.180.0150.00916.34
7.3.170.0120.00916.38
7.3.160.0130.00716.38
7.3.150.0140.00616.30
7.3.140.0110.01016.34
7.3.130.0120.00816.39
7.3.120.0130.00716.11
7.3.110.0090.01016.08
7.3.100.0110.01016.07
7.3.90.0110.01216.19
7.3.80.0130.00916.07
7.3.70.0100.01016.21
7.3.60.0120.00816.14
7.3.50.0140.00616.13
7.3.40.0110.01016.15
7.3.30.0120.00616.16
7.3.20.0220.00816.44
7.3.10.0220.00916.40
7.3.00.0150.00816.40
7.2.340.0130.00916.45
7.2.330.0170.00816.43
7.2.320.0130.01116.57
7.2.310.0150.00916.58
7.2.300.0170.00816.48
7.2.290.0140.00916.54
7.2.280.0160.00816.45
7.2.270.0150.00916.55
7.2.260.0150.00916.47
7.2.250.0150.00916.33
7.2.240.0170.00616.19
7.2.230.0140.00916.26
7.2.220.0130.01016.36
7.2.210.0140.00816.22
7.2.200.0130.01016.32
7.2.190.0140.00916.35
7.2.180.0120.01016.18
7.2.170.0120.01016.37
7.2.160.0140.00816.30
7.2.150.0200.01116.56
7.2.140.0150.01216.62
7.2.130.0190.00816.75
7.2.120.0200.01016.67
7.2.110.0170.00916.61
7.2.100.0170.00916.67
7.2.90.0220.00816.65
7.2.80.0180.01016.72
7.2.70.0230.00916.70
7.2.60.0150.00916.75
7.2.50.0180.00916.69
7.2.40.0130.00916.72
7.2.30.0150.01016.90
7.2.20.0210.00716.78
7.2.10.0180.00816.73
7.2.00.0210.01016.85
7.1.330.0170.01015.84
7.1.320.0180.00815.81
7.1.310.0160.01015.84
7.1.300.0200.00815.80
7.1.290.0170.00715.78
7.1.280.0170.00715.85
7.1.270.0180.00815.82
7.1.260.0180.00815.75
7.1.250.0190.00715.46
7.1.240.0230.00715.52
7.1.230.0220.00515.52
7.1.220.0210.00715.55
7.1.210.0190.01015.49
7.1.200.0180.00915.59
7.1.190.0190.01015.55
7.1.180.0290.00715.56
7.1.170.0230.00715.62
7.1.160.0200.00715.52
7.1.150.0210.00915.64
7.1.140.0200.00915.71
7.1.130.0200.01015.63
7.1.120.0200.00915.60
7.1.110.0250.00715.68
7.1.100.0200.00815.60
7.1.90.0290.00915.62
7.1.80.0170.01015.65
7.1.70.0210.00715.44
7.1.60.0250.00717.50
7.1.50.0210.00817.49
7.1.40.0210.00817.47
7.1.30.0330.00617.41
7.1.20.0250.00917.44
7.1.10.0180.01115.35
7.1.00.0160.01115.43
7.0.330.0240.00715.18
7.0.320.0220.00815.15
7.0.310.0260.00815.12
7.0.300.0220.00815.06
7.0.290.0200.01115.20
7.0.280.0220.00815.17
7.0.270.0260.01015.24
7.0.260.0240.00615.31
7.0.250.0180.01115.28
7.0.240.0220.00915.35
7.0.230.0210.01015.30
7.0.220.0240.00915.40
7.0.210.0230.00715.19
7.0.200.0220.00915.22
7.0.190.0230.00815.26
7.0.180.0200.00715.21
7.0.170.0240.00715.16
7.0.160.0250.00915.08
7.0.150.0260.00915.16
7.0.140.0210.00815.13
7.0.130.0230.00715.23
7.0.120.0240.00615.12
7.0.110.0200.01015.20
7.0.100.0210.00915.12
7.0.90.0270.00915.11
7.0.80.0210.00715.17
7.0.70.0240.01015.11
7.0.60.0240.00815.13
7.0.50.0250.00915.12
7.0.40.0200.01015.17
7.0.30.0230.00915.40
7.0.20.0210.00815.11
7.0.10.0200.01015.17
7.0.00.0220.00815.08
5.6.400.0170.01215.78
5.6.390.0170.00915.96
5.6.380.0140.01315.71
5.6.370.0160.01115.61
5.6.360.0200.00915.82
5.6.350.0190.00915.72
5.6.340.0200.00815.70
5.6.330.0170.01215.76
5.6.320.0170.01115.74
5.6.310.0190.00815.66
5.6.300.0190.01816.34
5.6.290.0140.02016.45
5.6.280.0180.01716.38
5.6.270.0190.01716.36
5.6.260.0170.01916.41
5.6.250.0160.01716.34
5.6.240.0160.01816.41
5.6.230.0190.01616.38
5.6.220.0190.01816.32
5.6.210.0160.01716.35
5.6.200.0170.01916.46
5.6.190.0180.01916.41
5.6.180.0180.02016.40
5.6.170.0180.01516.38
5.6.160.0190.01616.47
5.6.150.0190.01616.46
5.6.140.0170.01616.41
5.6.130.0180.01616.40
5.6.120.0180.01716.36
5.6.110.0120.02016.35
5.6.100.0150.01916.37
5.6.90.0170.01516.28
5.6.80.0160.01716.13
5.6.70.0170.01616.24
5.6.60.0170.01616.34
5.6.50.0170.01716.20
5.6.40.0160.01716.25
5.6.30.0180.01216.21
5.6.20.0170.01816.19
5.6.10.0160.01616.24
5.6.00.0150.01816.22

preferences:
36.86 ms | 403 KiB | 5 Q