3v4l.org

run code in 300+ PHP versions simultaneously
<?php function f($current_day, $delay) { if(($current_day+$delay) > 5) return ((min($current_day, 5))+($delay-1))%5)+1); else return $delay; } for($i = 1; $i < 8; $i++) printf("\tf(%d, 1) => %d\n", $i, f($i, 1)); printf("\n\n\n\n"); for($i = 1; $i < 8; $i++) printf("\tf(%d, 2) => %d\n", $i, f($i, 2));

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)
5.4.320.0230.05019.19
5.4.310.0330.06318.98
5.4.300.0270.06318.99
5.4.290.0370.06319.19
5.4.280.0200.05319.16
5.4.270.0300.04718.85
5.4.260.0200.05718.99
5.4.250.0330.07319.23
5.4.240.0330.05018.94
5.4.230.0370.05719.00
5.4.220.0330.03718.84
5.4.210.0200.04018.94
5.4.200.0200.05719.06
5.4.190.0300.04319.08
5.4.180.0270.04319.23
5.4.170.0300.06319.21
5.4.160.0300.04319.23
5.4.150.0400.05319.00
5.4.140.0300.07016.49
5.4.130.0270.07016.28
5.4.120.0300.06016.54
5.4.110.0270.07016.44
5.4.100.0270.06716.35
5.4.90.0230.03716.27
5.4.80.0330.06716.57
5.4.70.0330.06316.48
5.4.60.0270.06316.49
5.4.50.0270.07016.43
5.4.40.0330.06316.55
5.4.30.0370.06316.24
5.4.20.0330.06316.43
5.4.10.0300.05716.25
5.4.00.0300.04315.80
5.3.290.0270.04014.68
5.3.280.0170.05014.50
5.3.270.0330.07014.69
5.3.260.0200.08014.73
5.3.250.0230.05314.76
5.3.240.0270.05714.52
5.3.230.0270.04714.52
5.3.220.0300.06714.73
5.3.210.0300.06014.49
5.3.200.0300.06314.68
5.3.190.0370.06314.59
5.3.180.0270.07014.68
5.3.170.0330.05014.54
5.3.160.0270.06014.48
5.3.150.0300.06714.48
5.3.140.0270.04014.56
5.3.130.0330.04014.63
5.3.120.0200.04014.63
5.3.110.0370.05314.60
5.3.100.0300.03714.13
5.3.90.0300.03713.92
5.3.80.0230.07314.06
5.3.70.0270.07314.13
5.3.60.0300.07013.90
5.3.50.0400.05714.03
5.3.40.0300.05313.87
5.3.30.0330.05013.83
5.3.20.0370.04713.60
5.3.10.0330.04713.88
5.3.00.0270.06313.56
5.2.170.0200.05012.02
5.2.160.0230.05712.02
5.2.150.0200.03012.02
5.2.140.0430.04312.02
5.2.130.0300.03012.02
5.2.120.0200.05712.02
5.2.110.0300.05012.02
5.2.100.0200.05312.02
5.2.90.0230.03012.02
5.2.80.0270.05712.02
5.2.70.0270.05712.02
5.2.60.0230.05712.02
5.2.50.0200.03712.02
5.2.40.0170.03312.02
5.2.30.0170.03712.02
5.2.20.0270.05312.02
5.2.10.0200.03712.02
5.2.00.0270.05012.02
5.1.60.0200.04312.02
5.1.50.0170.03012.02
5.1.40.0230.04312.02
5.1.30.0200.04312.02
5.1.20.0230.05312.02
5.1.10.0200.05312.02
5.1.00.0230.04712.02
5.0.50.0100.03712.02
5.0.40.0170.02712.02
5.0.30.0170.05712.02
5.0.20.0070.04012.02
5.0.10.0100.04012.02
5.0.00.0130.06012.02
4.4.90.0100.01712.02
4.4.80.0100.02012.02
4.4.70.0100.03712.02
4.4.60.0070.03312.02
4.4.50.0100.02312.02
4.4.40.0100.05012.02
4.4.30.0130.03012.02
4.4.20.0070.03312.02
4.4.10.0130.03312.02
4.4.00.0070.03712.02
4.3.110.0070.03312.02
4.3.100.0130.02312.02
4.3.90.0100.03312.02
4.3.80.0130.05012.02
4.3.70.0130.03012.02
4.3.60.0130.03012.02
4.3.50.0070.04012.02
4.3.40.0070.05712.02
4.3.30.0030.03012.02
4.3.20.0100.02712.02
4.3.10.0070.01712.02
4.3.00.0030.03012.02

preferences:
141.47 ms | 1394 KiB | 7 Q