3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start_date = '2014-3-19'; $end_date = '2014-5-19'; $begin = new DateTime( $start_date ); $end = new DateTime(date("Y-m-d",strtotime("+1 day", strtotime($end_date)))); while($begin < $end) { if(isWeekend($begin)) { $period[] = $begin->format('Y-m-d'); $begin->modify('+1 day'); } } foreach($period as $val) { print_r("Value: " . $val . (isWeekend($val) ? " - weekend\n" : " - weekday\n")); } function isWeekend($date) { return (date('N', strtotime($date)) >= 6); }

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.60.0090.00618.34
8.3.50.0080.01021.21
8.3.40.0100.00618.99
8.3.30.0110.01119.23
8.3.20.0040.00420.25
8.3.10.0000.00822.10
8.3.00.0080.00022.40
8.2.180.0130.01016.88
8.2.170.0150.00322.96
8.2.160.0070.00719.46
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0140.00426.16
8.2.120.0060.00319.66
8.2.110.0090.00322.25
8.2.100.0040.00719.28
8.2.90.0000.00819.43
8.2.80.0000.00818.29
8.2.70.0060.00318.00
8.2.60.0030.00517.93
8.2.50.0050.00518.07
8.2.40.0080.00018.47
8.2.30.0030.00518.25
8.2.20.0050.00217.90
8.2.10.0000.00718.10
8.2.00.0070.00417.88
8.1.280.0070.00725.92
8.1.270.0060.00320.39
8.1.260.0070.00026.35
8.1.250.0080.00028.09
8.1.240.0030.00723.96
8.1.230.0090.00319.29
8.1.220.0030.00517.91
8.1.210.0000.00818.77
8.1.200.0060.00317.60
8.1.190.0080.00017.76
8.1.180.0030.00619.00
8.1.170.0000.00818.71
8.1.160.0070.00022.18
8.1.150.0040.00418.98
8.1.140.0000.00817.71
8.1.130.0050.00317.87
8.1.120.0040.00317.67
8.1.110.0040.00417.73
8.1.100.0040.00417.61
8.1.90.0000.00717.71
8.1.80.0000.00817.76
8.1.70.0040.00417.59
8.1.60.0080.00417.72
8.1.50.0060.00317.70
8.1.40.0080.00017.74
8.1.30.0080.00017.71
8.1.20.0040.00417.80
8.1.10.0040.00417.79
8.1.00.0080.00017.68
8.0.300.0050.00218.77
8.0.290.0040.00417.05
8.0.280.0030.00318.52
8.0.270.0000.00917.40
8.0.260.0030.00317.11
8.0.250.0030.00317.36
8.0.240.0040.00417.22
8.0.230.0000.00717.32
8.0.220.0030.00317.13
8.0.210.0070.00017.08
8.0.200.0000.00617.26
8.0.190.0040.00417.18
8.0.180.0030.00517.13
8.0.170.0030.00517.22
8.0.160.0000.00817.14
8.0.150.0040.00417.23
8.0.140.0080.00017.20
8.0.130.0060.00013.50
8.0.120.0040.00417.16
8.0.110.0030.00617.14
8.0.100.0000.00817.25
8.0.90.0040.00417.15
8.0.80.0090.01217.14
8.0.70.0050.00217.12
8.0.60.0000.00717.34
8.0.50.0050.00317.02
8.0.30.0120.00717.28
8.0.20.0110.00917.42
8.0.10.0000.00717.41
8.0.00.0110.01117.05
7.4.330.0030.00315.00
7.4.320.0030.00516.69
7.4.300.0030.00316.57
7.4.290.0110.00016.66
7.4.280.0030.00516.62
7.4.270.0040.00316.57
7.4.260.0050.00216.58
7.4.250.0000.00816.54
7.4.240.0000.00816.70
7.4.230.0040.00416.70
7.4.220.0100.00616.70
7.4.210.0110.00516.54
7.4.200.0000.00716.65
7.4.190.0040.00416.73
7.4.160.0070.01316.54
7.4.150.0110.01117.40
7.4.140.0130.01117.86
7.4.130.0170.00316.75
7.4.120.0120.00916.76
7.4.110.0130.01316.73
7.4.100.0110.01416.68
7.4.90.0120.00916.89
7.4.80.0070.01119.39
7.4.70.0130.00616.63
7.4.60.0120.01216.68
7.4.50.0030.00616.83
7.4.40.0070.00722.77
7.4.30.0100.00816.79
7.4.00.0140.00014.89
7.3.330.0000.00613.37
7.3.320.0030.00313.33
7.3.310.0000.00716.39
7.3.300.0030.00516.48
7.3.290.0130.00716.43
7.3.280.0090.00816.45
7.3.270.0120.01217.40
7.3.260.0170.01216.59
7.3.250.0150.00916.66
7.3.240.0090.01616.74
7.3.230.0230.00816.63
7.3.210.0120.00916.64
7.3.200.0090.00919.39
7.3.190.0170.00316.63
7.3.180.0040.01516.74
7.3.170.0100.01016.59
7.3.160.0140.00316.80
7.3.120.0070.01015.07
7.2.330.0030.01916.69
7.2.320.0170.00816.54
7.2.310.0070.01416.60
7.2.300.0160.00316.69
7.2.290.0150.00616.80
7.2.80.0040.01116.82
7.2.60.0070.00717.17
7.1.200.0000.01316.16
7.1.70.0030.00517.08
7.1.60.0130.01319.82
7.1.50.0100.01317.38
7.1.00.0000.05722.31
7.0.200.0030.00617.05
7.0.140.0030.07722.00
7.0.100.0370.07320.02
7.0.90.0270.05719.99
7.0.80.0470.07319.93
7.0.70.0400.05019.96
7.0.60.0370.08720.00
7.0.50.0400.07720.41
7.0.40.0070.04320.08
7.0.30.0000.07720.05
7.0.20.0030.05720.23
7.0.10.0070.04020.17
7.0.00.0100.08720.05
5.6.280.0100.06720.96
5.6.250.0070.07320.59
5.6.240.0070.07720.58
5.6.230.0030.04320.63
5.6.220.0170.07320.59
5.6.210.0200.07320.75
5.6.200.0070.08020.98
5.6.190.0130.07321.05
5.6.180.0100.07721.11
5.6.170.0070.04721.17
5.6.160.0030.06721.06
5.6.150.0030.03720.94
5.6.140.0030.08021.05
5.6.130.0030.05021.10
5.6.120.0070.05720.94
5.6.110.0130.07320.96
5.6.100.0170.07721.07
5.6.90.0030.08021.02
5.6.80.0130.07020.41
5.6.70.0130.07320.55
5.6.60.0030.07720.51
5.6.50.0030.08320.47
5.6.40.0030.05720.40
5.6.30.0100.07320.31
5.6.20.0030.08320.46
5.6.10.0130.07720.44
5.6.00.0070.07020.52
5.5.380.0130.08020.36
5.5.370.0030.06720.43
5.5.360.0100.06720.54
5.5.350.0170.06320.46
5.5.340.0300.06320.79
5.5.330.0100.06720.68
5.5.320.0170.06720.90
5.5.310.0070.06720.90
5.5.300.0130.05720.98
5.5.290.0030.07320.71
5.5.280.0070.06720.96
5.5.270.0230.05020.88
5.5.260.0130.07320.91
5.5.250.0070.07020.75
5.5.240.0170.06320.16
5.5.230.0170.06020.26
5.5.220.0130.05320.23
5.5.210.0100.06020.09
5.5.200.0100.06720.30
5.5.190.0100.06720.20
5.5.180.0200.05720.29
5.5.160.0130.07320.28
5.5.150.0070.07020.28
5.5.140.0170.07320.21
5.5.130.0270.04720.28
5.5.120.0130.08020.30
5.5.110.0070.07320.30
5.5.100.0230.07720.14
5.5.90.0130.06020.04
5.5.80.0200.05720.09
5.5.70.0100.06320.13
5.5.60.0200.05720.10
5.5.50.0100.05720.19
5.5.40.0130.05320.12
5.5.30.0200.06720.16
5.5.20.0270.05320.16
5.5.10.0270.04719.98
5.5.00.0130.05320.03
5.4.450.0170.07019.16
5.4.440.0000.07019.23
5.4.430.0100.06319.23
5.4.420.0170.04319.21
5.4.410.0030.06319.15
5.4.400.0100.06319.04
5.4.390.0030.07318.89
5.4.380.0170.05019.22
5.4.370.0100.07718.89
5.4.360.0130.05719.07
5.4.350.0230.07019.06
5.4.340.0070.06019.07
5.4.320.0230.05319.04
5.4.310.0130.05718.91
5.4.300.0070.06319.06
5.4.290.0330.03718.85
5.4.280.0100.05718.85
5.4.270.0200.05319.05
5.4.260.0070.06019.22
5.4.250.0170.05318.84
5.4.240.0200.04719.05
5.4.230.0100.05718.90
5.4.220.0130.06019.04
5.4.210.0070.06319.02
5.4.200.0100.06018.84
5.4.190.0270.05719.09
5.4.180.0030.06319.24
5.4.170.0230.06719.09
5.4.160.0070.05719.05
5.4.150.0130.07319.05
5.4.140.0130.05716.30
5.4.130.0130.04316.45
5.4.120.0070.05316.34
5.4.110.0170.04716.44
5.4.100.0130.06716.47
5.4.90.0070.06016.35
5.4.80.0130.04316.39
5.4.70.0100.06016.46
5.4.60.0130.05016.50
5.4.50.0070.07016.31
5.4.40.0100.06016.21
5.4.30.0100.08316.40
5.4.20.0130.06016.57
5.4.10.0100.05316.31
5.4.00.0200.04715.80
5.3.290.0200.08014.53
5.3.280.0130.06014.58
5.3.270.0100.07314.41
5.3.260.0030.06314.45
5.3.250.0300.04714.44
5.3.240.0130.05314.49
5.3.230.0070.05314.41
5.3.220.0070.05714.45
5.3.210.0130.06014.41
5.3.200.0070.06014.55
5.3.190.0130.05314.34
5.3.180.0130.05314.44
5.3.170.0200.04714.42
5.3.160.0130.07314.40
5.3.150.0170.07714.27
5.3.140.0100.08014.41
5.3.130.0230.05014.43
5.3.120.0170.06014.38
5.3.110.0130.06014.39
5.3.100.0130.05313.75
5.3.90.0270.05313.88
5.3.80.0270.04013.84
5.3.70.0200.05713.94
5.3.60.0200.05013.75
5.3.50.0170.06013.70
5.3.40.0170.04713.72
5.3.30.0170.05013.67
5.3.20.0130.05013.44
5.3.10.0170.04313.41
5.3.00.0100.07313.40

preferences:
30.15 ms | 401 KiB | 5 Q