3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = range(1, 18); // You can either index by 0 and add one, or 1 and subtract one for($i = 1; $i <= count($data); $i++) { // Variable for easier reference later $item = $data[$i - 1]; // On the fifth item, emit logic for just one if(0 === $i % 5){ echo 'Single: ' . $item; }else { // Grab the next if it exsts $next = $data[$i++] ?? null; if($next){ echo 'Double: ' . $item . ', ' . $next; }else{ echo 'Double: ' . $item; } } echo PHP_EOL; }

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.4.130.0100.01017.86
8.4.120.0140.00722.35
8.4.110.0150.00622.39
8.4.100.0120.00818.40
8.4.90.0100.01022.18
8.4.80.0110.00918.58
8.4.70.0100.00417.88
8.4.60.0030.00519.00
8.4.50.0170.00718.61
8.4.40.0100.01017.63
8.4.30.0040.01522.11
8.4.20.0070.00317.81
8.4.10.0060.00322.18
8.3.260.0100.01016.50
8.3.250.0110.00719.00
8.3.240.0130.00617.27
8.3.230.0110.00716.51
8.3.220.0100.00918.93
8.3.210.0040.01016.68
8.3.200.0060.00316.62
8.3.190.0080.01116.82
8.3.180.0090.01017.10
8.3.170.0130.00718.92
8.3.160.0180.00019.03
8.3.150.0110.00717.11
8.3.140.0090.00616.67
8.3.130.0050.00318.61
8.3.120.0080.00018.80
8.3.110.0040.00416.66
8.3.100.0080.00824.06
8.3.90.0040.00426.77
8.3.80.0060.00317.97
8.3.70.0110.00718.43
8.3.60.0140.00718.43
8.3.50.0100.01016.59
8.3.40.0120.00321.89
8.3.30.0070.00719.13
8.3.20.0060.00324.18
8.3.10.0040.00424.66
8.3.00.0030.00726.16
8.2.290.0120.00520.49
8.2.280.0040.00518.19
8.2.270.0150.00416.98
8.2.260.0180.00016.63
8.2.250.0000.00816.69
8.2.240.0080.00019.14
8.2.230.0030.00620.94
8.2.220.0060.00337.54
8.2.210.0040.00426.77
8.2.200.0030.00618.29
8.2.190.0140.00316.63
8.2.180.0110.00316.75
8.2.170.0100.01018.91
8.2.160.0090.00922.96
8.2.150.0040.00425.66
8.2.140.0000.00924.66
8.2.130.0070.00026.16
8.2.120.0040.00422.18
8.2.110.0050.00522.32
8.2.100.0060.00617.72
8.2.90.0060.00617.75
8.2.80.0260.00417.50
8.2.70.0310.00517.37
8.2.60.0320.00017.13
8.2.50.0260.00317.61
8.2.40.0190.00717.63
8.2.30.0250.00417.50
8.2.20.0240.00317.50
8.2.10.0270.00217.25
8.2.00.0220.00717.50
8.1.330.0090.01021.85
8.1.320.0130.00615.96
8.1.310.0040.01418.45
8.1.300.0090.00018.54
8.1.290.0080.00030.84
8.1.280.0110.01125.92
8.1.270.0040.00424.66
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0060.00322.66
8.1.230.0110.00022.53
8.1.220.0210.01117.00
8.1.210.0240.00317.13
8.1.200.0280.00316.84
8.1.190.0270.00017.00
8.1.180.0230.00317.11
8.1.170.0210.00617.25
8.1.160.0210.00617.46
8.1.150.0230.00417.00
8.1.140.0230.00517.25
8.1.130.0150.01117.00
8.1.120.0220.00617.00
8.1.110.0190.00817.25
8.1.100.0170.01017.00
8.1.90.0210.00717.13
8.1.80.0250.00417.25
8.1.70.0250.00317.25
8.1.60.0280.00017.25
8.1.50.0200.00817.13
8.1.40.0200.00817.25
8.1.30.0260.00417.25
8.1.20.0230.00517.38
8.1.10.0260.00017.60
8.1.00.0250.00317.50
8.0.300.0270.00316.80
8.0.290.0240.00416.80
8.0.280.0230.00416.80
8.0.270.0290.00016.80
8.0.260.0190.00616.80
8.0.250.0210.00716.80
8.0.240.0200.01016.80
8.0.230.0260.00616.80
8.0.220.0320.00316.80
8.0.210.0200.00816.80
8.0.200.0260.00816.80
8.0.190.0230.00616.80
8.0.180.0200.00716.80
8.0.170.0170.01116.80
8.0.160.0230.00416.80
8.0.150.0220.00516.80
8.0.140.0220.00716.80
8.0.130.0250.00416.80
8.0.120.0190.01016.80
8.0.110.0190.00916.80
8.0.100.0250.00416.80
8.0.90.0180.00616.80
8.0.80.0220.00316.80
8.0.70.0240.00316.80
8.0.60.0280.00016.80
8.0.50.0200.00616.80
8.0.30.0190.00716.80
8.0.20.0220.00516.80
8.0.10.0220.00516.80

preferences:
30.69 ms | 403 KiB | 5 Q