3v4l.org

run code in 300+ PHP versions simultaneously
<?php function scoutWeekly($n) { // today's date $today = new DateTime(); // set to first day of the month $today->setDate($today->format('Y'), $today->format('m'), 1); // get the Monday earlier $today->sub(new DateInterval('P' . ($today->format('N') - 1) . 'D')); // add the required number of weeks if ($n > 1) { $today->add(new DateInterval('P' . ($n - 1) . 'W')); } // and format the result return $today->format('d M') . '-' . $today->add(new DateInterval('P6D'))->format('d M'); } echo scoutWeekly(1) . "\n"; echo scoutWeekly(2) . "\n"; echo scoutWeekly(3) . "\n";

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.5.10.0060.01116.76
8.5.00.0140.00720.02
8.4.150.0020.00114.05
8.4.140.0130.00917.92
8.4.130.0120.00619.12
8.4.120.0060.00520.41
8.4.110.0110.00920.64
8.4.100.0130.00718.63
8.4.90.0060.00320.93
8.4.80.0100.01018.91
8.4.70.0120.00818.87
8.4.60.0120.01020.60
8.4.50.0100.01118.62
8.4.40.0050.00322.43
8.4.30.0190.00022.58
8.4.20.0080.01218.40
8.4.10.0000.01019.55
8.3.280.0130.00818.56
8.3.270.0100.00916.86
8.3.260.0130.00816.75
8.3.250.0120.00817.13
8.3.240.0120.00816.59
8.3.230.0100.00616.91
8.3.220.0110.00819.04
8.3.210.0040.00418.72
8.3.200.0050.00516.82
8.3.190.0090.00617.07
8.3.180.0090.01118.69
8.3.170.0110.00716.75
8.3.160.0070.01117.29
8.3.150.0090.00019.05
8.3.140.0040.00419.12
8.3.130.0000.00818.73
8.3.120.0030.01318.70
8.3.110.0090.00016.75
8.3.100.0000.00824.06
8.3.90.0070.00326.77
8.3.80.0030.00718.56
8.3.70.0070.01416.75
8.3.60.0110.00418.43
8.3.50.0120.00517.42
8.3.40.0050.01018.76
8.3.30.0070.00718.88
8.3.20.0050.00220.54
8.3.10.0050.00320.73
8.3.00.0050.00320.80
8.2.290.0110.00820.52
8.2.280.0140.01018.66
8.2.270.0110.00416.95
8.2.260.0100.00716.83
8.2.250.0150.00316.47
8.2.240.0000.00818.96
8.2.230.0030.00920.94
8.2.220.0040.00437.54
8.2.210.0040.00426.77
8.2.200.0100.00018.41
8.2.190.0040.01116.63
8.2.180.0090.00625.92
8.2.170.0110.01119.01
8.2.160.0170.00019.46
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00419.89
8.2.110.0070.00320.90
8.2.100.0120.00018.03
8.2.90.0040.00417.75
8.2.80.0050.00318.03
8.2.70.0080.00018.03
8.2.60.0040.00418.21
8.2.50.0000.00818.10
8.2.40.0050.00319.49
8.2.30.0070.00019.21
8.2.20.0000.00718.13
8.2.10.0050.00219.55
8.2.00.0000.00718.00
8.1.330.0090.01021.79
8.1.320.0090.01318.07
8.1.310.0000.00816.16
8.1.300.0060.00316.38
8.1.290.0090.00030.84
8.1.280.0100.01025.92
8.1.270.0130.00723.91
8.1.260.0000.00826.35
8.1.250.0100.00028.09
8.1.240.0040.00422.01
8.1.230.0120.00022.68
8.1.220.0040.00417.77
8.1.210.0060.00318.77
8.1.200.0030.00717.60
8.1.190.0040.00417.47
8.1.180.0000.00818.10
8.1.170.0080.00018.62
8.1.160.0040.00419.07
8.1.150.0040.00418.97
8.1.140.0070.00020.21
8.1.130.0060.00317.64
8.1.120.0000.00717.65
8.1.110.0070.00017.68
8.1.100.0040.00417.55
8.1.90.0040.00717.58
8.1.80.0040.00417.58
8.1.70.0030.00317.57
8.1.60.0040.00417.63
8.1.50.0060.00317.68
8.1.40.0000.00817.71
8.1.30.0080.00017.85
8.1.20.0040.00417.67
8.1.10.0030.00517.60
8.1.00.0040.00417.75
8.0.300.0040.00422.03
8.0.290.0030.00617.00
8.0.280.0000.00718.45
8.0.270.0070.00017.05
8.0.260.0030.00317.08
8.0.250.0000.00717.13
8.0.240.0000.00717.16
8.0.230.0040.00417.18
8.0.220.0060.00317.17
8.0.210.0030.00317.07
8.0.200.0000.00817.20
8.0.190.0050.00517.15
8.0.180.0030.00517.19
8.0.170.0050.00317.10
8.0.160.0000.00817.27
8.0.150.0000.00717.02
8.0.140.0070.00017.02
8.0.130.0000.00613.44
8.0.120.0000.00817.13
8.0.110.0050.00217.13
8.0.100.0030.00517.02
8.0.90.0040.00417.04
8.0.80.0090.01217.12
8.0.70.0040.00417.03
8.0.60.0050.00217.18
8.0.50.0050.00217.04
8.0.30.0120.01017.21
8.0.20.0130.00717.40
8.0.10.0000.00817.11
8.0.00.0110.00917.00
7.4.330.0050.00015.55
7.4.320.0030.00316.77
7.4.300.0070.00016.73
7.4.290.0030.00316.71
7.4.280.0000.00816.66
7.4.270.0070.00016.61
7.4.260.0000.00716.68
7.4.250.0000.00716.64
7.4.240.0030.00316.73
7.4.230.0030.00316.76
7.4.220.0070.00016.64
7.4.210.0090.00816.74
7.4.200.0000.00716.84
7.4.160.0090.00716.74
7.4.130.0060.01916.61
7.4.120.0070.01116.63
7.4.110.0130.00416.63
7.4.100.0080.00916.55
7.4.90.0170.00016.64
7.4.80.0080.00819.39
7.4.70.0130.01016.67
7.4.60.0140.01116.54
7.4.50.0120.00316.72
7.4.40.0130.01016.58
7.4.10.0100.00716.77
7.4.00.0060.00915.78
7.3.330.0020.00213.29
7.3.320.0030.00313.25
7.3.310.0030.00316.46
7.3.300.0000.00716.33
7.3.290.0000.00816.46
7.3.280.0070.00816.39
7.3.260.0130.00516.65
7.3.240.0090.01016.66
7.3.230.0070.01016.72
7.3.210.0130.00616.42
7.3.200.0080.01516.60
7.3.190.0120.00916.68
7.3.180.0080.01216.79
7.3.170.0060.01316.54
7.3.160.0060.00916.59
7.3.130.0070.01016.54
7.3.120.0070.00615.77
7.3.110.0100.00615.69
7.3.100.0030.01015.95
7.3.90.0070.00615.82
7.3.80.0060.00515.73
7.3.70.0040.00915.71
7.3.60.0050.01215.79
7.3.50.0050.00615.89
7.3.40.0020.01415.77
7.3.30.0050.01015.72
7.3.20.0220.00616.63
7.3.10.0210.01116.71
7.3.00.0220.01116.65
7.2.330.0100.00716.91
7.2.320.0070.01017.05
7.2.310.0090.00916.68
7.2.300.0090.00816.93
7.2.290.0060.01316.90
7.2.260.0130.00716.84
7.2.250.0080.01016.12
7.2.240.0020.01315.85
7.2.230.0060.00915.97
7.2.220.0060.01016.15
7.2.210.0050.00715.94
7.2.200.0060.00915.91
7.2.190.0080.00816.04
7.2.180.0090.00715.91
7.2.170.0050.00915.97
7.2.160.0040.01116.82
7.2.150.0340.01116.95
7.2.140.0350.00816.79
7.2.130.0370.00616.81
7.2.120.0320.00716.94
7.2.110.0320.01016.98
7.2.100.0390.00516.75
7.2.90.0640.00717.00
7.2.80.0250.00516.90
7.2.70.0440.00717.03
7.2.60.0390.01016.93
7.2.50.0350.00716.88
7.2.40.0290.01117.04
7.2.30.0280.00817.04
7.2.20.0330.00516.88
7.2.10.0350.00716.87
7.2.00.0190.01116.97
7.1.330.0040.00916.63
7.1.320.0050.00516.73
7.1.310.0060.00616.75
7.1.300.0050.00816.65
7.1.290.0030.01216.72
7.1.280.0050.00816.63
7.1.270.0030.01016.80
7.1.260.0050.00816.67
7.1.250.0270.01015.88
7.1.240.0100.00317.48
7.1.230.0090.00617.23
7.1.220.0070.01017.46
7.1.210.0100.00717.47
7.1.200.0070.00717.36
7.1.190.0060.00917.39
7.1.180.0090.00617.48
7.1.170.0060.00617.44
7.1.160.0040.01117.50
7.1.150.0060.00617.40
7.1.140.0030.01117.52
7.1.130.0050.00517.37
7.1.120.0080.00317.36
7.1.110.0060.00917.58
7.1.100.0100.01017.65
7.1.90.0130.00617.34
7.1.80.0100.01017.43
7.1.70.0060.01217.38
7.1.60.0060.00917.38
7.1.50.0090.01217.38
7.1.40.0090.00617.50
7.1.30.0070.00717.68
7.1.20.0100.00717.44
7.1.10.0090.00617.45
7.1.00.0090.00617.36

preferences:
149.1 ms | 403 KiB | 5 Q