3v4l.org

run code in 300+ PHP versions simultaneously
<?php $startOfWeek = '16-07-2017'; $endOfWeek = new DateTime($startOfWeek); echo $endOfWeek->format('d-m-Y') . "\n"; $endOfWeek->modify('+5 day'); echo $endOfWeek->format('d-m-Y') . "\n"; $endOfWeekString = $endOfWeek->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.0000.01516.88
8.3.50.0030.01016.45
8.3.40.0070.00718.96
8.3.30.0110.00418.97
8.3.20.0050.00220.29
8.3.10.0040.00421.87
8.3.00.0000.00819.51
8.2.180.0140.00318.41
8.2.170.0070.01422.96
8.2.160.0110.00420.55
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0080.00021.02
8.2.120.0080.00026.35
8.2.110.0050.00520.56
8.2.100.0040.00817.93
8.2.90.0040.00419.34
8.2.80.0030.00517.97
8.2.70.0060.00317.88
8.2.60.0050.00317.93
8.2.50.0040.00418.10
8.2.40.0040.00420.45
8.2.30.0000.00819.38
8.2.20.0000.00818.06
8.2.10.0070.00018.15
8.2.00.0040.00418.25
8.1.280.0170.00025.92
8.1.270.0040.00423.70
8.1.260.0070.00026.35
8.1.250.0000.00728.09
8.1.240.0060.00323.92
8.1.230.0060.00617.64
8.1.220.0030.00517.89
8.1.210.0000.00818.77
8.1.200.0090.00017.60
8.1.190.0040.00417.48
8.1.180.0040.00418.10
8.1.170.0100.00518.32
8.1.160.0030.00519.05
8.1.150.0070.00019.02
8.1.140.0000.00719.75
8.1.130.0040.00418.97
8.1.120.0000.00717.63
8.1.110.0000.00817.66
8.1.100.0020.00517.70
8.1.90.0000.00717.71
8.1.80.0030.00317.71
8.1.70.0000.00717.72
8.1.60.0070.00017.78
8.1.50.0030.00517.68
8.1.40.0040.00417.69
8.1.30.0040.00417.84
8.1.20.0060.00317.79
8.1.10.0000.00717.74
8.1.00.0030.00617.80
8.0.300.0060.00318.77
8.0.290.0000.00717.00
8.0.280.0000.00718.58
8.0.270.0000.00817.39
8.0.260.0000.00717.09
8.0.250.0000.00717.26
8.0.240.0030.00317.23
8.0.230.0070.00017.14
8.0.220.0030.00317.03
8.0.210.0000.00817.10
8.0.200.0030.00317.13
8.0.190.0070.00017.21
8.0.180.0000.00717.18
8.0.170.0040.00417.11
8.0.160.0000.00717.17
8.0.150.0000.00817.00
8.0.140.0000.00717.15
8.0.130.0030.00313.54
8.0.120.0040.00417.07
8.0.110.0000.00817.13
8.0.100.0040.00417.05
8.0.90.0070.00017.18
8.0.80.0100.00717.21
8.0.70.0070.00017.04
8.0.60.0000.00717.17
8.0.50.0040.00416.97
8.0.30.0060.01217.40
8.0.20.0130.00517.40
8.0.10.0050.00217.33
8.0.00.0090.00916.94
7.4.330.0000.00515.55
7.4.320.0030.00316.84
7.4.300.0030.00316.78
7.4.290.0030.00616.70
7.4.280.0080.00416.80
7.4.270.0000.00816.73
7.4.260.0000.00716.71
7.4.250.0030.00516.68
7.4.240.0050.00316.79
7.4.230.0030.00516.90
7.4.220.0070.01116.76
7.4.210.0040.01116.64
7.4.200.0040.00416.80
7.4.160.0090.01116.78
7.4.150.0080.01117.40
7.4.140.0150.01017.86
7.4.130.0120.00616.73
7.4.120.0100.00816.72
7.4.110.0090.00916.70
7.4.100.0060.01416.63
7.4.90.0040.01416.60
7.4.80.0130.00619.39
7.4.70.0090.00616.83
7.4.60.0100.00716.73
7.4.50.0100.00616.56
7.4.40.0060.01616.92
7.4.30.0140.00816.58
7.4.10.0100.00516.70
7.4.00.0100.00815.97
7.3.330.0050.00013.42
7.3.320.0030.00313.47
7.3.310.0040.00416.39
7.3.300.0050.00316.51
7.3.290.0060.01116.50
7.3.280.0060.01016.48
7.3.270.0110.00617.40
7.3.260.0080.01016.70
7.3.250.0090.00916.63
7.3.240.0110.00616.81
7.3.230.0140.00616.70
7.3.210.0070.01016.61
7.3.200.0090.01016.62
7.3.190.0090.00616.78
7.3.180.0060.01216.80
7.3.170.0080.00816.65
7.3.160.0100.00716.66
7.3.130.0040.01516.60
7.3.120.0130.00816.33
7.3.110.0140.00316.64
7.3.100.0100.00716.63
7.3.90.0070.00716.66
7.3.80.0030.00816.68
7.3.70.0100.00716.36
7.3.60.0090.00616.58
7.3.50.0030.01016.63
7.3.40.0090.00916.44
7.3.30.0100.00716.36
7.3.20.0060.01018.32
7.3.10.0030.01418.30
7.3.00.0030.01118.38
7.2.330.0060.01216.65
7.2.320.0100.00616.78
7.2.310.0030.01316.82
7.2.300.0090.00916.96
7.2.290.0190.00016.98
7.2.260.0190.00316.68
7.2.250.0060.01316.89
7.2.240.0120.00916.80
7.2.230.0000.01516.61
7.2.220.0080.00816.96
7.2.210.0070.00716.84
7.2.200.0070.01016.68
7.2.190.0080.00916.64
7.2.180.0030.01016.76
7.2.170.0060.01016.79
7.2.160.0030.01416.67
7.2.150.0070.01018.52
7.2.140.0160.00018.64
7.2.130.0040.01318.52
7.2.120.0070.00718.71
7.2.110.0130.00618.54
7.2.100.0090.00618.39
7.2.90.0200.00816.69
7.2.80.0570.01216.69
7.2.70.0150.00416.82
7.2.60.0070.01116.92
7.2.50.0050.01216.86
7.2.40.0650.00217.05
7.2.30.0110.01016.88
7.2.20.0210.01016.97
7.2.10.0540.01116.87
7.2.00.0050.01016.98
7.1.330.0000.01717.60
7.1.320.0030.00817.69
7.1.310.0080.00817.72
7.1.300.0070.00717.71
7.1.290.0070.01017.52
7.1.280.0160.00317.70
7.1.270.0100.00617.48
7.1.260.0070.01417.58
7.1.250.0090.00917.46
7.1.240.0090.00917.64
7.1.230.0100.01017.57
7.1.220.0080.00817.52
7.1.210.0100.00315.85
7.1.200.0120.00415.79
7.1.190.0470.00315.75
7.1.180.0360.00815.73
7.1.170.0200.00515.79
7.1.160.0060.00715.91
7.1.150.0080.00715.71
7.1.140.0180.01115.83
7.1.130.0130.00515.77
7.1.120.0330.01115.76
7.1.110.0060.01015.81
7.1.100.0320.00515.77
7.1.90.0160.00715.82
7.1.80.0200.00615.97
7.1.70.0090.00615.86
7.1.60.0190.00524.85
7.1.50.0180.00924.87
7.1.40.0170.00824.80
7.1.30.0180.00824.67
7.1.20.0110.01024.70
7.1.10.0380.00515.81
7.1.00.0160.00615.77
7.0.330.0070.00717.36
7.0.320.0040.01217.07
7.0.310.0080.00715.24
7.0.300.0210.00514.97
7.0.290.0090.00915.21
7.0.280.0100.00515.40
7.0.270.0060.00715.33
7.0.260.0330.00315.24
7.0.250.0150.00715.31
7.0.240.0570.00815.51
7.0.230.0110.00515.41
7.0.220.0040.01015.45
7.0.210.0170.00715.48
7.0.200.0090.00815.43
7.0.190.0260.00715.52
7.0.180.0080.00915.49
7.0.170.0100.00515.44
7.0.160.0760.00315.32
7.0.150.0630.00615.35
7.0.140.0190.00515.56
7.0.130.0210.00515.49
7.0.120.0050.01015.54
7.0.110.0080.00815.38
7.0.100.0210.00715.32
7.0.90.0060.00915.32
7.0.80.0030.01215.48
7.0.70.0040.01115.44
7.0.60.0120.00315.64
7.0.50.0040.00715.47
7.0.40.0060.00914.51
7.0.30.1090.01114.46
7.0.20.0550.00814.47
7.0.10.0080.00814.54
7.0.00.0090.00714.49
5.6.400.0090.00716.13
5.6.390.0090.00915.77
5.6.380.0120.00615.89
5.6.370.0000.01315.99
5.6.360.0070.01015.88
5.6.350.0070.01016.18
5.6.340.0100.00815.93
5.6.330.0000.01616.12
5.6.320.0040.01316.00
5.6.310.0040.01116.13
5.6.300.0110.00416.10
5.6.290.0090.00915.97
5.6.280.0070.01016.14
5.6.270.0030.01316.05
5.6.260.0070.01016.12
5.6.250.0000.01715.91
5.6.240.0060.00915.86
5.6.230.0040.01516.04
5.6.220.0030.01315.94
5.6.210.0100.00716.09
5.6.200.0170.00016.05
5.6.190.0000.01715.81
5.6.180.0030.01315.96
5.6.170.0080.00416.13
5.6.160.0060.00916.03
5.6.150.0030.01315.98
5.6.140.0110.00315.74
5.6.130.0100.00715.84
5.6.120.0060.00916.14
5.6.110.0000.01415.95
5.6.100.0130.00315.98
5.6.90.0110.00816.06
5.6.80.0070.01015.98
5.6.70.0060.01316.12
5.6.60.0060.00915.86
5.6.50.0100.00715.81
5.6.40.0070.00416.03
5.6.30.0100.00316.07
5.6.20.0070.00316.02
5.6.10.0110.00515.91
5.6.00.0070.01015.82

preferences:
40.28 ms | 401 KiB | 5 Q