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; $startDate->modify('first day of this week'); $endDate->modify('last day of 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.60.0120.00316.50
8.3.50.0040.01116.42
8.3.40.0140.00418.92
8.3.30.0120.00918.83
8.3.20.0050.00320.13
8.3.10.0100.00023.45
8.3.00.0040.00421.91
8.2.180.0040.01818.41
8.2.170.0120.00322.96
8.2.160.0060.00919.14
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0080.00021.11
8.2.120.0040.00426.35
8.2.110.0070.00320.89
8.2.100.0130.00018.16
8.2.90.0080.00319.36
8.2.80.0030.00617.97
8.2.70.0100.00017.88
8.2.60.0000.00818.05
8.2.50.0080.00018.07
8.2.40.0030.00618.47
8.2.30.0040.00418.12
8.2.20.0060.00318.27
8.2.10.0000.00718.15
8.2.00.0000.00718.29
8.1.280.0070.01125.92
8.1.270.0000.00822.22
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0110.00319.39
8.1.230.0040.00820.74
8.1.220.0080.00017.88
8.1.210.0090.00018.77
8.1.200.0000.00817.61
8.1.190.0040.00417.47
8.1.180.0050.00518.10
8.1.170.0040.00418.87
8.1.160.0000.00718.96
8.1.150.0040.00420.75
8.1.140.0000.00719.79
8.1.130.0070.00018.98
8.1.120.0000.00717.65
8.1.110.0030.00617.70
8.1.100.0080.00017.77
8.1.90.0040.00417.70
8.1.80.0040.00417.66
8.1.70.0000.00817.63
8.1.60.0000.00817.80
8.1.50.0030.00517.66
8.1.40.0040.00417.75
8.1.30.0030.00517.79
8.1.20.0080.00017.85
8.1.10.0080.00017.69
8.1.00.0040.00417.80
8.0.300.0000.00818.77
8.0.290.0040.00417.00
8.0.280.0030.00518.52
8.0.270.0080.00017.41
8.0.260.0000.00716.98
8.0.250.0000.00717.11
8.0.240.0070.00317.11
8.0.230.0040.00417.11
8.0.220.0070.00017.09
8.0.210.0000.00717.08
8.0.200.0060.00017.25
8.0.190.0090.00017.24
8.0.180.0000.00717.11
8.0.170.0040.00417.23
8.0.160.0040.00417.22
8.0.150.0040.00417.13
8.0.140.0000.00717.20
8.0.130.0000.00613.58
8.0.120.0000.00817.05
8.0.110.0080.00017.05
8.0.100.0000.00717.14
8.0.90.0040.00417.14
8.0.80.0100.00617.12
8.0.70.0040.00416.99
8.0.60.0080.00017.20
8.0.50.0050.00317.00
8.0.30.0130.00717.21
8.0.20.0120.00717.42
8.0.10.0040.00417.13
8.0.00.0060.01216.86
7.4.330.0030.00315.55
7.4.320.0030.00316.82
7.4.300.0000.00616.80
7.4.290.0000.00816.77
7.4.280.0040.00416.72
7.4.270.0030.00316.68
7.4.260.0030.00516.85
7.4.250.0000.00816.79
7.4.240.0000.00716.83
7.4.230.0030.00516.74
7.4.220.0060.01316.75
7.4.210.0060.00916.71
7.4.200.0040.00416.55
7.4.160.0040.01316.55
7.4.150.0130.01317.40
7.4.140.0110.00717.86
7.4.130.0100.01016.61
7.4.120.0120.00916.72
7.4.110.0110.00716.65
7.4.100.0140.00316.74
7.4.90.0090.00916.53
7.4.80.0060.01219.39
7.4.70.0040.01316.85
7.4.60.0060.01216.72
7.4.50.0060.00916.84
7.4.40.0040.01516.82
7.4.30.0170.00316.59
7.4.00.0030.01115.03
7.3.330.0000.00613.38
7.3.320.0050.00013.46
7.3.310.0050.00216.61
7.3.300.0030.00316.59
7.3.290.0070.00716.49
7.3.280.0100.00816.49
7.3.270.0070.01017.40
7.3.260.0060.01216.63
7.3.250.0110.00816.54
7.3.240.0110.00816.56
7.3.230.0130.00316.65
7.3.210.0170.00016.71
7.3.200.0100.00616.69
7.3.190.0100.01016.45
7.3.180.0110.00716.83
7.3.170.0150.00916.82
7.3.160.0040.01416.63
7.3.120.0030.01615.15
7.3.110.0090.00915.05
7.3.100.0100.00314.82
7.3.90.0070.00315.08
7.3.80.0110.00714.91
7.3.70.0030.01015.01
7.3.60.0070.01014.91
7.3.50.0060.00315.07
7.3.40.0070.00714.85
7.3.30.0110.00414.96
7.3.20.0060.00916.90
7.3.10.0070.00616.74
7.3.00.0080.00316.80
7.2.330.0090.01016.67
7.2.320.0110.00916.91
7.2.310.0150.00916.71
7.2.300.0070.01016.89
7.2.290.0120.00916.69
7.2.250.0100.01015.49
7.2.240.0070.01415.13
7.2.230.0090.00915.37
7.2.220.0070.00715.04
7.2.210.0070.00715.11
7.2.200.0070.01015.10
7.2.190.0090.00315.07
7.2.180.0000.01215.25
7.2.170.0040.01115.05
7.2.130.0070.01016.80
7.2.120.0000.01117.09
7.2.110.0070.01016.89
7.2.100.0060.00317.16
7.2.90.0100.01017.19
7.2.80.0060.01616.76
7.2.70.0190.00816.79
7.2.60.0070.00916.98
7.2.50.0090.00616.89
7.2.40.0070.00717.16
7.2.30.0060.00917.14
7.2.20.0040.01117.16
7.2.10.0040.00817.06
7.2.00.0050.00818.25
7.1.330.0100.00316.07
7.1.320.0130.00315.83
7.1.310.0070.00716.06
7.1.300.0090.00916.08
7.1.290.0120.00315.86
7.1.280.0000.00915.86
7.1.270.0000.01316.09
7.1.260.0000.01116.01
7.1.250.0030.01015.92
7.1.200.0060.00916.12
7.1.100.0060.00918.35
7.1.70.0090.00917.15
7.1.60.0230.01435.23
7.1.50.0210.01034.93
7.1.40.0240.01734.55
7.1.30.0240.02034.83
7.1.20.0310.00934.67
7.1.10.0070.01316.64
7.1.00.0070.01016.88
7.0.200.0040.01316.95
7.0.190.0110.00616.91
7.0.180.0030.01716.13
7.0.170.0140.00616.59
7.0.160.0040.01516.38
7.0.150.0000.02016.28
7.0.140.0070.01316.55
7.0.130.0090.00616.54
7.0.120.0070.01016.53
7.0.110.0120.00916.64
7.0.100.0070.01716.61
7.0.90.0060.01516.21
7.0.80.0070.01416.41
7.0.70.0230.00316.35
7.0.60.0080.01216.37
7.0.50.0140.00616.38
7.0.40.0100.00916.77
7.0.30.0080.01116.73
7.0.20.0090.00916.44
7.0.10.0080.01116.42
7.0.00.0030.01916.70

preferences:
47.72 ms | 401 KiB | 5 Q