3v4l.org

run code in 300+ PHP versions simultaneously
<?php $startOfWeek = '16-07-2017'; $endOfWeek = new DateTime($startOfWeek); var_dump($endOfWeek); $endOfWeekString = $endOfWeek->modify('+5 day')->format('d-m-Y'); function firstDayOfWeek($date) { $day = DateTime::createFromFormat('d-m-Y', $date); $day->setISODate((int)$day->format('o'), (int)$day->format('W'), 1); return $day->format('d-m-Y'); } var_dump(firstDayOfWeek($startOfWeek)); echo $endOfWeekString;

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.0060.00916.75
8.3.50.0070.00716.60
8.3.40.0000.01418.85
8.3.30.0110.00418.66
8.3.20.0040.00419.97
8.3.10.0040.00421.76
8.3.00.0060.00319.38
8.2.180.0140.00718.41
8.2.170.0090.00622.96
8.2.160.0030.01020.52
8.2.150.0040.00424.18
8.2.140.0030.00624.66
8.2.130.0050.00321.00
8.2.120.0070.00026.35
8.2.110.0050.00521.18
8.2.100.0060.00618.03
8.2.90.0070.00319.77
8.2.80.0040.00418.16
8.2.70.0030.00518.18
8.2.60.0040.00418.34
8.2.50.0060.00318.10
8.2.40.0000.00720.34
8.2.30.0040.00419.43
8.2.20.0040.00418.17
8.2.10.0070.00018.06
8.2.00.0070.00018.12
8.1.280.0070.01425.92
8.1.270.0000.00823.95
8.1.260.0050.00226.35
8.1.250.0000.00728.09
8.1.240.0030.00623.96
8.1.230.0030.00920.88
8.1.220.0030.00517.80
8.1.210.0040.00418.77
8.1.200.0000.00917.60
8.1.190.0030.00517.48
8.1.180.0060.00318.10
8.1.170.0080.00018.71
8.1.160.0070.00019.09
8.1.150.0000.00819.00
8.1.140.0050.00219.77
8.1.130.0080.00019.00
8.1.120.0000.00717.62
8.1.110.0040.00417.66
8.1.100.0080.00017.65
8.1.90.0070.00017.79
8.1.80.0000.00717.66
8.1.70.0070.00017.64
8.1.60.0030.00617.68
8.1.50.0000.00717.62
8.1.40.0000.00917.64
8.1.30.0000.00717.67
8.1.20.0090.00017.78
8.1.10.0000.00817.76
8.1.00.0040.00417.82
8.0.300.0070.00020.06
8.0.290.0050.00317.00
8.0.280.0070.00018.52
8.0.270.0040.00417.08
8.0.260.0040.00417.02
8.0.250.0030.00317.09
8.0.240.0040.00417.11
8.0.230.0030.00317.19
8.0.220.0030.00316.98
8.0.210.0040.00417.08
8.0.200.0050.00217.20
8.0.190.0040.00417.06
8.0.180.0000.00717.14
8.0.170.0040.00417.10
8.0.160.0000.00717.05
8.0.150.0080.00016.94
8.0.140.0070.00017.07
8.0.130.0030.00313.43
8.0.120.0050.00217.07
8.0.110.0080.00017.06
8.0.100.0070.00017.12
8.0.90.0040.00417.08
8.0.80.0100.01017.05
8.0.70.0050.00216.97
8.0.60.0020.00517.14
8.0.50.0040.00417.11
8.0.30.0170.00517.34
8.0.20.0100.01017.47
8.0.10.0040.00417.24
8.0.00.0090.00917.06
7.4.330.0000.00515.55
7.4.320.0030.00516.66
7.4.300.0000.00616.80
7.4.290.0060.00316.68
7.4.280.0070.00516.79
7.4.270.0050.00216.72
7.4.260.0030.00316.71
7.4.250.0040.00416.67
7.4.240.0000.00716.70
7.4.230.0000.00716.90
7.4.220.0070.01116.72
7.4.210.0090.00616.57
7.4.200.0040.00416.87
7.4.160.0170.00116.73
7.4.150.0110.00717.40
7.4.140.0160.00917.86
7.4.130.0120.00616.70
7.4.120.0110.00916.67
7.4.110.0090.01216.75
7.4.100.0100.01416.58
7.4.90.0190.00016.73
7.4.80.0150.00619.39
7.4.70.0030.01316.61
7.4.60.0080.00816.76
7.4.50.0070.00716.47
7.4.40.0150.00716.70
7.4.30.0060.00916.82
7.4.00.0030.01015.12
7.3.330.0000.00513.56
7.3.320.0000.00513.32
7.3.310.0070.00016.50
7.3.300.0070.00016.55
7.3.290.0100.00716.47
7.3.280.0070.00816.49
7.3.270.0090.00917.40
7.3.260.0110.00716.51
7.3.250.0070.01216.65
7.3.240.0090.00816.70
7.3.230.0080.00916.64
7.3.210.0090.00916.66
7.3.200.0080.00916.99
7.3.190.0060.01016.72
7.3.180.0060.00916.69
7.3.170.0060.01516.77
7.3.160.0090.00916.71
7.3.10.0070.00716.91
7.3.00.0110.00416.82
7.2.330.0270.01016.74
7.2.320.0170.00016.68
7.2.310.0070.01316.98
7.2.300.0110.00616.89
7.2.290.0150.00316.95
7.2.130.0070.00316.93
7.2.120.0000.01216.85
7.2.110.0060.00616.93
7.2.100.0070.00716.95
7.2.90.0230.00915.97
7.2.80.0230.00616.15
7.2.70.0220.01016.09
7.2.60.0090.00816.26
7.2.50.0100.00516.15
7.2.40.0200.00916.04
7.2.30.0150.00616.01
7.2.20.0050.00816.06
7.2.10.0190.01116.15
7.2.00.0100.00616.09
7.1.250.0090.00316.00
7.1.210.0420.01313.90
7.1.200.0030.01714.30
7.1.190.0160.00514.18
7.1.180.0490.00313.84
7.1.170.0220.00014.18
7.1.160.0830.00714.16
7.1.150.0140.00314.24
7.1.140.0080.00613.84
7.1.130.0110.00414.14
7.1.120.0600.00614.09
7.1.110.0070.00714.19
7.1.100.0090.00614.13
7.1.90.0620.00314.12
7.1.80.0360.00314.38
7.1.70.0950.01014.23
7.1.60.0320.01631.79
7.1.50.0240.01032.35
7.1.40.0740.00432.01
7.1.30.0680.01332.00
7.1.20.0220.01232.21
7.1.10.0120.00314.36
7.1.00.0650.01014.21
7.0.310.0120.00613.55
7.0.300.0160.00813.48
7.0.290.0610.00713.66
7.0.280.0530.00613.40
7.0.270.0140.00313.77
7.0.260.0260.01013.44
7.0.250.0660.00613.63
7.0.240.0270.00713.71
7.0.230.0610.00613.95
7.0.220.0570.00313.43
7.0.210.0990.01013.55
7.0.200.0480.00613.82
7.0.190.0470.00713.77
7.0.180.0660.00313.76
7.0.170.0060.00913.66
7.0.160.0590.00713.77
7.0.150.0540.00813.68
7.0.140.0550.00713.80
7.0.130.0580.00313.61
7.0.120.0090.00613.86
7.0.110.0130.00713.62
7.0.100.0030.01213.93
7.0.90.0510.00713.63
7.0.80.0530.00713.98
7.0.70.0280.00713.81
7.0.60.0350.00313.88
7.0.50.0650.01013.88
7.0.40.0500.01314.01
7.0.30.0060.00613.78
7.0.20.0160.01013.77
7.0.10.0110.00713.56
7.0.00.0870.00313.64

preferences:
45.99 ms | 400 KiB | 5 Q