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($i-5)%8))-4)+1; } foreach($assertions as $count => $assert) { if (countFingerPingPong($count) !== $assert) { throw new Exception('Assesstions 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.0040.01118.68
8.3.60.0490.00725.92
8.3.50.0200.00725.92
8.3.40.0400.00925.92
8.3.30.0410.00325.92
8.3.20.0450.00025.92
8.3.10.0340.01125.92
8.3.00.0350.01325.92
8.2.190.0110.00716.63
8.2.180.0310.00925.92
8.2.170.0320.01625.92
8.2.160.0440.00625.92
8.2.150.0340.01525.92
8.2.140.0350.01325.92
8.2.130.0400.01025.92
8.2.120.0240.01025.92
8.2.110.0370.01725.92
8.2.100.0330.00325.92
8.2.90.0290.00625.92
8.2.80.0290.00425.92
8.2.70.0430.00425.92
8.2.60.0310.00325.92
8.2.50.0270.00825.92
8.2.40.0280.00725.92
8.2.30.0200.01025.92
8.2.20.0260.00625.92
8.2.10.0220.01325.92
8.2.00.0280.00325.92
8.1.280.0300.00325.92
8.1.270.0370.00925.92
8.1.260.0410.01025.92
8.1.250.0470.01025.92
8.1.240.0310.00725.92
8.1.230.0250.01125.92
8.1.220.0290.01325.92
8.1.210.0270.01125.92
8.1.200.0250.01625.92
8.1.190.0350.01125.92
8.1.180.0260.01425.92
8.1.170.0380.00325.92
8.1.160.0230.01925.92
8.1.150.0300.01225.92
8.1.140.0180.01225.92
8.1.130.0210.00925.92
8.1.120.0290.00425.92
8.1.110.0240.00925.92
8.1.100.0190.01225.92
8.1.90.0200.01025.92
8.1.80.0280.00325.92
8.1.70.0260.00525.92
8.1.60.0270.00625.92
8.1.50.0280.00625.92
8.1.40.0310.00325.92
8.1.30.0310.00325.92
8.1.20.0230.00925.92
8.1.10.0290.00425.92
8.1.00.0360.01025.92

preferences:
19.61 ms | 401 KiB | 5 Q