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('monday this week'); $endDate->modify('last day of 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.0110.00416.88
8.3.50.0070.00716.84
8.3.40.0040.01119.02
8.3.30.0100.01018.96
8.3.20.0080.00020.34
8.3.10.0060.00621.68
8.3.00.0030.00522.09
8.2.180.0060.01218.79
8.2.170.0090.00622.96
8.2.160.0080.00819.30
8.2.150.0050.00324.18
8.2.140.0130.00324.66
8.2.130.0000.00821.20
8.2.120.0040.00426.35
8.2.110.0000.01021.18
8.2.100.0120.00018.34
8.2.90.0080.00019.34
8.2.80.0080.00018.02
8.2.70.0030.00517.75
8.2.60.0050.00318.05
8.2.50.0060.00318.10
8.2.40.0000.00820.49
8.2.30.0080.00019.51
8.2.20.0000.00818.21
8.2.10.0000.00718.32
8.2.00.0000.00818.25
8.1.280.0090.00925.92
8.1.270.0040.00422.23
8.1.260.0050.00326.35
8.1.250.0050.00228.09
8.1.240.0060.00323.92
8.1.230.0040.00719.21
8.1.220.0040.00417.90
8.1.210.0000.00818.77
8.1.200.0030.00617.47
8.1.190.0080.00017.47
8.1.180.0050.00318.10
8.1.170.0040.00818.62
8.1.160.0040.00419.19
8.1.150.0040.00420.87
8.1.140.0060.00319.61
8.1.130.0040.00418.96
8.1.120.0000.00717.82
8.1.110.0040.00417.60
8.1.100.0000.00817.63
8.1.90.0040.00417.68
8.1.80.0050.00217.69
8.1.70.0050.00317.79
8.1.60.0090.00017.71
8.1.50.0080.00017.72
8.1.40.0000.00917.71
8.1.30.0040.00417.77
8.1.20.0000.01017.84
8.1.10.0030.00517.77
8.1.00.0040.00417.81
8.0.300.0040.00418.77
8.0.290.0000.00716.88
8.0.280.0030.00518.60
8.0.270.0030.00317.29
8.0.260.0030.00317.23
8.0.250.0070.00017.22
8.0.240.0060.00317.30
8.0.230.0000.00717.20
8.0.220.0000.00717.28
8.0.210.0030.00317.12
8.0.200.0050.00317.32
8.0.190.0000.00917.25
8.0.180.0000.00717.30
8.0.170.0000.00717.30
8.0.160.0050.00217.34
8.0.150.0040.00417.13
8.0.140.0040.00417.08
8.0.130.0030.00313.59
8.0.120.0040.00417.11
8.0.110.0040.00417.11
8.0.100.0040.00417.09
8.0.90.0050.00317.26
8.0.80.0060.01217.26
8.0.70.0000.00817.21
8.0.60.0080.00017.17
8.0.50.0050.00217.28
8.0.30.0100.00917.41
8.0.20.0090.01017.50
8.0.10.0070.00017.19
8.0.00.0090.00917.03
7.4.330.0050.00015.55
7.4.320.0030.00316.72
7.4.300.0000.00616.80
7.4.290.0070.00016.58
7.4.280.0000.00716.75
7.4.270.0000.00716.81
7.4.260.0040.00416.73
7.4.250.0050.00216.78
7.4.240.0040.00416.68
7.4.230.0080.00016.83
7.4.220.0090.00916.74
7.4.210.0090.00616.75
7.4.200.0040.00416.79
7.4.160.0100.00716.76
7.4.150.0090.01017.40
7.4.140.0120.01117.86
7.4.130.0120.01216.63
7.4.120.0140.01116.72
7.4.110.0120.00616.70
7.4.100.0070.01416.75
7.4.90.0200.00016.54
7.4.80.0110.00719.39
7.4.70.0080.01316.67
7.4.60.0060.01016.78
7.4.50.0030.00616.72
7.4.40.0110.00716.83
7.4.30.0180.00616.94
7.4.00.0100.00615.38
7.3.330.0000.00613.28
7.3.320.0050.00013.44
7.3.310.0050.00216.61
7.3.300.0030.00516.55
7.3.290.0060.00816.53
7.3.280.0080.00816.54
7.3.270.0070.01117.40
7.3.260.0070.01316.64
7.3.250.0120.00816.63
7.3.240.0140.00616.66
7.3.230.0090.01016.79
7.3.210.0150.00316.47
7.3.200.0070.01016.61
7.3.190.0110.00516.78
7.3.180.0070.01016.58
7.3.170.0160.00616.57
7.3.160.0130.00316.68
7.2.330.0040.01416.63
7.2.320.0000.01816.84
7.2.310.0130.01016.65
7.2.300.0140.00316.71
7.2.290.0060.01216.73
7.2.60.0060.00916.95
7.2.00.0040.01419.65
7.1.200.0060.00616.08
7.1.100.0070.00718.51
7.1.70.0030.01517.33
7.1.60.0170.02035.24
7.1.50.0280.00934.69
7.1.40.0210.01234.51
7.1.30.0200.01034.79
7.1.20.0170.01434.68
7.1.10.0140.00416.72
7.1.00.0100.00716.81
7.0.200.0000.01817.13
7.0.190.0060.01216.97
7.0.180.0090.01516.49
7.0.170.0060.01016.59
7.0.160.0060.01016.55
7.0.150.0000.02016.41
7.0.140.0100.00916.32
7.0.130.0040.01216.72
7.0.120.0070.00716.64
7.0.110.0060.01316.35
7.0.100.0060.00916.30
7.0.90.0000.01516.38
7.0.80.0030.01216.73
7.0.70.0000.01616.66
7.0.60.0040.01216.29
7.0.50.0070.01016.53
7.0.40.0090.00616.53
7.0.30.0090.00916.56
7.0.20.0060.01016.57
7.0.10.0070.00716.48
7.0.00.0110.00516.57

preferences:
37.84 ms | 401 KiB | 5 Q