3v4l.org

run code in 300+ PHP versions simultaneously
<?php $assertions = [ 1 => 1, 4 => 4, 5 => 5, 6 => 4, 8 => 2, 9 => 1, 10 => 2, 11 => 3, 12 => 4, 13 => 5, 14 => 4, 15 => 3, 16 => 2, 17 => 1, 18 => 2, 19 => 3, 20 => 4, 21 => 5, 22 => 4, ]; /** * @param positive-int $count * @return positive-int */ function countFingerPingPong(int $count): int { return abs(((abs($count-5)%8))-4)+1; } foreach($assertions as $count => $assert) { if (countFingerPingPong($count) !== $assert) { throw new Exception('Assertions failed.'); } }

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.70.0120.00418.18
8.3.60.0430.01225.92
8.3.50.0170.00725.92
8.3.40.0430.00625.92
8.3.30.0320.01225.92
8.3.20.0370.00625.92
8.3.10.0270.01625.92
8.3.00.0440.00025.92
8.2.190.0120.00416.58
8.2.180.0400.00425.92
8.2.170.0340.01525.92
8.2.160.0370.01025.92
8.2.150.0410.01025.92
8.2.140.0350.00725.92
8.2.130.0300.01225.92
8.2.120.0440.00825.92
8.2.110.0260.01025.92
8.2.100.0320.00825.92
8.2.90.0280.01425.92
8.2.80.0330.00825.92
8.2.70.0360.00725.92
8.2.60.0240.01625.92
8.2.50.0240.00925.92
8.2.40.0240.00625.92
8.2.30.0230.01525.92
8.2.20.0310.00325.92
8.2.10.0240.01725.92
8.2.00.0380.01325.92
8.1.280.0260.01525.92
8.1.270.0480.00625.92
8.1.260.0330.00925.92
8.1.250.0320.01425.92
8.1.240.0320.00725.92
8.1.230.0330.00725.92
8.1.220.0320.01025.92
8.1.210.0310.01225.92
8.1.200.0370.00825.92
8.1.190.0340.00625.92
8.1.180.0330.00725.92
8.1.170.0340.00825.92
8.1.160.0420.00025.92
8.1.150.0280.01125.92
8.1.140.0330.00325.92
8.1.130.0410.00325.92
8.1.120.0340.01425.92
8.1.110.0430.00025.92
8.1.100.0350.00825.92
8.1.90.0230.01925.92
8.1.80.0400.00325.92
8.1.70.0230.01925.92
8.1.60.0420.00425.92
8.1.50.0360.01125.92
8.1.40.0380.00325.92
8.1.30.0390.00725.92
8.1.20.0420.00725.92
8.1.10.0440.00325.92
8.1.00.0400.00325.92

preferences:
16.7 ms | 401 KiB | 5 Q