3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getStartAndEndDateOfWeek($week, $year) { $dto = new DateTime(); $dto->setISODate($year, $week); $ret['week_start'] = $dto->format('Y-m-d'); $dto->modify('+7 days');//1 day extra for BETWEEN query fix $ret['week_end'] = $dto->format('Y-m-d'); return $ret; } //last week $lastWeek = (new DateTime('now'))->sub(new DateInterval('P7D'))->format('W'); $year = (new DateTime('now'))->sub(new DateInterval('P7D'))->format('Y'); $dateRange = getStartAndEndDateOfWeek($lastWeek, $year); print_r($dateRange);

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.0150.00016.50
8.3.50.0130.00521.27
8.3.40.0150.00018.92
8.3.30.0070.01118.84
8.3.20.0040.00420.34
8.3.10.0040.00421.77
8.3.00.0090.00021.94
8.2.180.0140.00716.75
8.2.170.0090.00622.96
8.2.160.0110.00420.52
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0030.00521.20
8.2.120.0040.00426.35
8.2.110.0030.00619.13
8.2.100.0110.00017.97
8.2.90.0090.00017.90
8.2.80.0040.00417.97
8.2.70.0040.00417.88
8.2.60.0050.00518.05
8.2.50.0000.00918.09
8.2.40.0000.00822.27
8.2.30.0070.00019.59
8.2.20.0070.00017.86
8.2.10.0050.00218.11
8.2.00.0040.00418.13
8.1.280.0150.00625.92
8.1.270.0080.00022.19
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0060.00322.12
8.1.230.0030.00920.95
8.1.220.0050.00317.88
8.1.210.0050.00318.98
8.1.200.0060.00317.60
8.1.190.0000.00817.48
8.1.180.0000.00918.10
8.1.170.0080.00018.59
8.1.160.0040.00420.86
8.1.150.0100.00018.82
8.1.140.0060.00319.57
8.1.130.0000.00817.77
8.1.120.0000.00717.68
8.1.110.0020.00517.55
8.1.100.0000.00817.61
8.1.90.0040.00417.55
8.1.80.0000.01117.54
8.1.70.0000.00717.64
8.1.60.0080.00017.78
8.1.50.0040.00417.72
8.1.40.0030.00717.69
8.1.30.0000.00817.86
8.1.20.0030.00517.70
8.1.10.0020.00517.63
8.1.00.0040.00417.75
8.0.300.0000.00720.02
8.0.290.0040.00417.00
8.0.280.0000.00718.53
8.0.270.0050.00217.38
8.0.260.0030.00317.32
8.0.250.0050.00317.06
8.0.240.0000.00717.20
8.0.230.0070.00017.16
8.0.220.0040.00417.11
8.0.210.0000.00717.07
8.0.200.0000.00717.20
8.0.190.0060.00317.11
8.0.180.0070.00017.02
8.0.170.0000.00717.09
8.0.160.0070.00017.12
8.0.150.0000.00717.00
8.0.140.0000.00717.10
8.0.130.0000.00513.41
8.0.120.0040.00416.92
8.0.110.0000.00717.05
8.0.100.0000.00716.96
8.0.90.0000.00717.05
8.0.80.0080.00717.15
8.0.70.0030.00516.96
8.0.60.0040.00416.93
8.0.50.0000.00716.94
8.0.30.0080.01017.16
8.0.20.0110.00717.42
8.0.10.0000.00717.33
8.0.00.0110.00716.84
7.4.330.0030.00316.83
7.4.320.0000.00616.62
7.4.300.0040.00416.69
7.4.290.0000.00716.71
7.4.280.0040.00416.82
7.4.270.0070.00016.57
7.4.260.0030.00316.76
7.4.250.0040.00416.69
7.4.240.0000.00716.76
7.4.230.0070.00016.83
7.4.220.0180.00016.83
7.4.210.0030.01016.85
7.4.200.0000.00716.80
7.4.160.0050.01116.79
7.4.150.0070.01117.40
7.4.140.0100.01117.86
7.4.130.0130.00516.57
7.4.120.0090.00716.60
7.4.110.0030.01516.81
7.4.100.0170.00016.67
7.4.90.0130.00316.60
7.4.80.0110.00719.39
7.4.70.0100.00716.68
7.4.60.0090.00616.65
7.4.50.0090.00916.75
7.4.40.0060.00916.34
7.4.30.0070.01516.81
7.4.00.0090.00015.38
7.3.330.0000.00613.53
7.3.320.0030.00313.48
7.3.310.0000.00716.49
7.3.300.0070.00016.45
7.3.290.0000.00616.40
7.3.280.0100.00916.49
7.3.270.0070.01117.40
7.3.260.0100.00716.81
7.3.250.0100.00916.53
7.3.240.0040.01316.62
7.3.230.0100.00716.71
7.3.210.0000.01816.81
7.3.200.0090.01319.39
7.3.190.0100.00716.48
7.3.180.0030.01416.96
7.3.170.0060.01316.60
7.3.160.0090.00616.70
7.2.330.0070.01816.90
7.2.320.0130.00316.86
7.2.310.0060.01016.71
7.2.300.0000.02116.65
7.2.290.0140.00816.93
7.2.60.0050.01316.81
7.2.00.0000.01319.45
7.1.200.0030.00916.21
7.1.100.0030.00718.28
7.1.70.0000.00817.44
7.1.60.0060.01919.40
7.1.50.0070.00716.70
7.1.00.0000.07722.36
7.0.200.1400.00014.98
7.0.60.0100.03321.84
7.0.50.0070.08317.88
7.0.40.0030.04720.02
7.0.30.0300.07720.11
7.0.20.0330.07720.10
7.0.10.0070.09020.03
7.0.00.0030.09020.16
5.6.280.0000.03721.15
5.6.210.0170.07320.45
5.6.200.0130.07718.14
5.6.190.0130.07320.48
5.6.180.0230.03720.63
5.6.170.0400.08320.54
5.6.160.0030.05320.51
5.6.150.0130.07718.15
5.6.140.0070.03318.18
5.6.130.0100.07718.21
5.6.120.0030.05021.12
5.6.110.0030.07021.14
5.6.100.0070.09021.03
5.6.90.0100.07020.97
5.6.80.0030.04020.44
5.5.350.0300.07320.43
5.5.340.0030.04717.99
5.5.330.0100.06020.38
5.5.320.0370.06320.27
5.5.310.0100.05320.30
5.5.300.0070.07718.08
5.5.290.0000.04317.98
5.5.280.0100.08320.79
5.5.270.0100.05020.80
5.5.260.0170.06720.65
5.5.250.0100.08020.62
5.5.240.0200.07020.13

preferences:
79.45 ms | 401 KiB | 5 Q