3v4l.org

run code in 300+ PHP versions simultaneously
<?php $yearMonth = '2017-06'; $firstDayOfThisMonth = new \DateTime($yearMonth . '-01'); var_dump($firstDayOfThisMonth->format('W')); $lastDayOfThisMonth = clone $firstDayOfThisMonth; $lastDayOfThisMonth = $lastDayOfThisMonth->modify('last day of this month'); var_dump($lastDayOfThisMonth->format('W')); $startDate = new \DateTime($firstDayOfThisMonth->format('Y') . 'W' . $firstDayOfThisMonth->format('W')); $endDate = new \DateTime($lastDayOfThisMonth->format('Y') . 'W' . $lastDayOfThisMonth->format('W')); $endDate->modify('+6 days 23:59:59'); var_dump($startDate); var_dump($endDate); $startDate = new \DateTime($yearMonth . '-01'); $endDate = clone $startDate; $endDate->modify('last day of this month'); $startDate->modify('monday this week'); $endDate->modify('sunday this week'); var_dump($startDate); var_dump($endDate);

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.0110.00716.73
8.3.60.0090.00616.50
8.3.50.0100.00516.63
8.3.40.0110.00418.85
8.3.30.0060.00918.79
8.3.20.0040.00420.30
8.3.10.0070.00321.78
8.3.00.0030.00522.09
8.2.180.0070.01118.68
8.2.170.0100.01022.96
8.2.160.0110.00419.33
8.2.150.0060.00324.18
8.2.140.0030.00624.66
8.2.130.0040.00421.11
8.2.120.0040.00426.35
8.2.110.0090.00019.36
8.2.100.0080.00418.28
8.2.90.0070.00319.22
8.2.80.0030.00618.03
8.2.70.0060.00317.88
8.2.60.0030.00518.18
8.2.50.0040.00418.10
8.2.40.0050.00320.60
8.2.30.0040.00419.46
8.2.20.0060.00318.22
8.2.10.0000.00818.30
8.2.00.0000.00818.32
8.1.280.0090.00925.92
8.1.270.0080.00022.23
8.1.260.0120.00326.35
8.1.250.0040.00428.09
8.1.240.0030.00622.80
8.1.230.0080.00419.17
8.1.220.0040.00417.79
8.1.210.0040.00418.77
8.1.200.0030.00617.37
8.1.190.0040.00417.60
8.1.180.0000.00818.10
8.1.170.0000.00918.71
8.1.160.0020.00519.11
8.1.150.0000.00718.97
8.1.140.0070.00019.72
8.1.130.0040.00418.95
8.1.120.0030.00617.79
8.1.110.0080.00017.63
8.1.100.0040.00417.77
8.1.90.0030.00517.69
8.1.80.0070.00017.77
8.1.70.0000.00717.75
8.1.60.0040.00417.82
8.1.50.0030.00617.76
8.1.40.0000.00817.70
8.1.30.0000.00817.86
8.1.20.0040.00417.84
8.1.10.0040.00417.70
8.1.00.0040.00417.75
8.0.300.0000.00818.77
8.0.290.0060.00317.00
8.0.280.0030.00318.50
8.0.270.0050.00217.41
8.0.260.0000.00717.04
8.0.250.0000.00717.26
8.0.240.0060.00317.23
8.0.230.0000.00717.25
8.0.220.0070.00017.06
8.0.210.0070.00017.14
8.0.200.0000.00717.09
8.0.190.0060.00317.25
8.0.180.0040.00417.18
8.0.170.0040.00417.27
8.0.160.0000.00717.07
8.0.150.0000.00717.13
8.0.140.0070.00017.17
8.0.130.0000.00613.57
8.0.120.0030.00517.14
8.0.110.0040.00417.20
8.0.100.0020.00517.04
8.0.90.0000.00717.18
8.0.80.0070.01517.23
8.0.70.0060.00317.20
8.0.60.0040.00417.16
8.0.50.0000.00717.19
8.0.30.0100.01217.34
8.0.20.0130.00717.40
8.0.10.0050.00217.25
8.0.00.0120.01416.87
7.4.330.0000.00515.55
7.4.320.0030.00316.82
7.4.300.0000.00616.79
7.4.290.0070.00016.77
7.4.280.0000.00816.76
7.4.270.0000.00716.71
7.4.260.0040.00316.72
7.4.250.0030.00316.77
7.4.240.0030.00416.75
7.4.230.0000.00816.55
7.4.220.0070.01016.81
7.4.210.0070.01016.58
7.4.200.0000.00716.78
7.4.160.0050.01216.63
7.4.150.0170.00017.40
7.4.140.0080.01117.86
7.4.130.0130.01016.85
7.4.120.0060.01416.63
7.4.110.0130.00516.68
7.4.100.0150.00716.52
7.4.90.0130.00816.80
7.4.80.0100.01319.39
7.4.70.0100.00716.67
7.4.60.0030.01316.61
7.4.50.0100.00316.48
7.4.40.0080.00816.59
7.4.30.0110.00716.64
7.4.00.0120.00415.24
7.3.330.0000.00513.28
7.3.320.0000.00513.23
7.3.310.0030.00316.31
7.3.300.0040.00416.52
7.3.290.0090.00716.50
7.3.280.0100.00816.49
7.3.270.0090.00917.40
7.3.260.0150.00316.62
7.3.250.0090.00916.67
7.3.240.0130.01116.59
7.3.230.0150.00316.61
7.3.210.0090.00916.68
7.3.200.0090.00916.86
7.3.190.0160.00316.45
7.3.180.0070.01116.54
7.3.170.0090.01216.59
7.3.160.0160.00016.82
7.2.330.0090.00916.94
7.2.320.0100.00816.59
7.2.310.0180.00616.52
7.2.300.0110.00716.91
7.2.290.0060.01216.68
7.2.60.0070.00716.61
7.2.00.0040.00419.46
7.1.200.0030.01015.93
7.1.100.0040.00818.54
7.1.70.0000.01417.48
7.1.60.0100.01935.36
7.1.50.0180.01234.90
7.1.40.0220.01034.67
7.1.30.0310.00034.66
7.1.20.0150.01734.88
7.1.10.0030.01216.80
7.1.00.0060.00916.79
7.0.200.0080.00617.12
7.0.190.0100.01016.77
7.0.180.0090.00916.41
7.0.170.0150.00016.18
7.0.160.0070.00816.31
7.0.150.0060.00916.12
7.0.140.0100.00516.53
7.0.130.0000.01916.52
7.0.120.0030.01216.64
7.0.110.0000.01416.52
7.0.100.0070.01016.52
7.0.90.0000.01516.50
7.0.80.0090.00916.56
7.0.70.0030.01216.34
7.0.60.0140.00016.29
7.0.50.0120.00316.55
7.0.40.0040.01116.73
7.0.30.0060.00916.49
7.0.20.0030.01316.42
7.0.10.0090.00616.51
7.0.00.0050.01116.59

preferences:
40.53 ms | 401 KiB | 5 Q