3v4l.org

run code in 300+ PHP versions simultaneously
<?php print_r(getFirstDayInMonth(new DateTime())); function getFirstDayInMonth($date) { $firstDayInMonth = $date->modify("first day of this month"); if($firstDayInMonth->format("Y-m-d") == date("Y-m-d", easter_date($firstDayInMonth->format($firstDayInMonth->format("Y"))))) $firstDayInMonth->modify("+2 days"); // posunutí z neděle na úterý if($firstDayInMonth->format($firstDayInMonth->format("Y")) == 2024) $firstDayInMonth->modify("+1 day"); // 1. leden if($firstDayInMonth == new DateTime("1.1.".$firstDayInMonth->format("Y"))) $firstDayInMonth->modify("+1 day"); // 1. květen print_r($firstDayInMonth); print_r(new DateTime($firstDayInMonth->format("Y") . "-05-01")); if($firstDayInMonth == new DateTime($firstDayInMonth->format("Y") . "-05-01")) $firstDayInMonth->modify("+1 day"); // zjištění dnu v týdnu $numberOfDay = $firstDayInMonth->format("w"); //sobota if($numberOfDay == 6) $firstDayInMonth = $firstDayInMonth->modify("+2 days"); // neděle if($numberOfDay == 0) // ne $firstDayInMonth = $firstDayInMonth->modify("+1 day"); return $firstDayInMonth; }

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.5.10.0080.00916.89
8.5.00.0140.00920.21
8.4.150.0020.00014.05
8.4.140.0170.00517.74
8.4.130.0130.00818.35
8.4.120.0020.00923.87
8.4.110.0100.01022.61
8.4.100.0150.00718.96
8.4.90.0120.00818.77
8.4.80.0100.00620.62
8.4.70.0050.00318.13
8.4.60.0110.01218.83
8.4.50.0030.00620.63
8.4.40.0170.00317.92
8.4.30.0050.00319.80
8.4.20.0210.00019.95
8.4.10.0060.00318.93
8.3.280.0120.00718.66
8.3.270.0070.01317.02
8.3.260.0150.00516.63
8.3.250.0130.00718.75
8.3.240.0100.00717.01
8.3.230.0110.00716.67
8.3.220.0040.00319.04
8.3.210.0080.00616.63
8.3.200.0030.00616.61
8.3.190.0120.00617.11
8.3.180.0080.01217.13
8.3.170.0110.00718.75
8.3.160.0130.00617.21
8.3.150.0160.00317.14
8.3.140.0030.00517.16
8.3.130.0030.00618.62
8.3.120.0000.00819.01
8.3.110.0060.00620.94
8.3.100.0060.00324.06
8.3.90.0040.00426.77
8.3.80.0000.00918.68
8.3.70.0120.00616.88
8.3.60.0090.01218.68
8.3.50.0110.00518.61
8.3.40.0120.00318.82
8.3.30.0130.00318.95
8.3.20.0080.00019.19
8.3.10.0040.00421.77
8.3.00.0000.00822.30
8.2.290.0110.00720.30
8.2.280.0040.00518.75
8.2.270.0120.00317.46
8.2.260.0170.00017.10
8.2.250.0080.00018.83
8.2.240.0070.00317.26
8.2.230.0070.01022.58
8.2.220.0060.00337.54
8.2.210.0040.00426.77
8.2.200.0090.00017.00
8.2.190.0100.01017.13
8.2.180.0040.01118.54
8.2.170.0070.00722.96
8.2.160.0000.01520.43
8.2.150.0050.00224.18
8.2.140.0080.00024.66
8.2.130.0080.00021.12
8.2.120.0000.00826.35
8.2.110.0070.00319.39
8.2.100.0080.00418.03
8.2.90.0000.00819.22
8.2.80.0030.00517.97
8.2.70.0000.00817.93
8.2.60.0040.00418.05
8.2.50.0030.00618.11
8.2.40.0090.00021.02
8.2.30.0050.00321.20
8.2.20.0040.00418.20
8.2.10.0040.00418.18
8.2.00.0030.00519.22
8.1.330.0060.01222.00
8.1.320.0120.00816.84
8.1.310.0150.00316.69
8.1.300.0130.00620.18
8.1.290.0060.00330.84
8.1.280.0150.00625.92
8.1.270.0040.00422.31
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0070.00319.52
8.1.230.0040.00817.83
8.1.220.0000.00817.77
8.1.210.0050.00318.77
8.1.200.0080.00017.61
8.1.190.0110.00417.38
8.1.180.0000.00918.10
8.1.170.0050.00318.71
8.1.160.0040.00419.00
8.1.150.0030.00619.20
8.1.140.0050.00217.81
8.1.130.0030.00319.24
8.1.120.0040.00417.60
8.1.110.0040.00417.71
8.1.100.0000.00717.69
8.1.90.0040.00417.58
8.1.80.0000.01017.71
8.1.70.0030.00717.70
8.1.60.0000.00817.84
8.1.50.0060.00317.74
8.1.40.0060.00317.75
8.1.30.0040.00417.82
8.1.20.0060.00317.81
8.1.10.0000.00817.73
8.1.00.0060.00317.74
8.0.300.0060.00318.90
8.0.290.0050.00316.88
8.0.280.0070.00018.51
8.0.270.0000.00717.36
8.0.260.0000.00917.29
8.0.250.0000.00717.13
8.0.240.0000.00917.21
8.0.230.0030.00317.08
8.0.220.0000.00717.12
8.0.210.0040.00417.19
8.0.200.0040.00417.27
8.0.190.0000.00817.23
8.0.180.0030.00617.10
8.0.170.0090.00017.10
8.0.160.0040.00417.17
8.0.150.0040.00417.01
8.0.140.0000.00817.18
8.0.130.0000.00513.43
8.0.120.0030.00517.06
8.0.110.0040.00417.07
8.0.100.0000.00717.16
8.0.90.0000.00917.20
8.0.80.0080.00617.13
8.0.70.0070.00017.30
8.0.60.0000.00817.17
8.0.50.0030.00517.02
8.0.30.0090.00917.36
8.0.20.0140.00517.40
8.0.10.0030.00517.35
8.0.00.0080.01116.91
7.4.330.0000.00415.55
7.4.320.0030.00316.75
7.4.300.0000.00616.83
7.4.290.0000.00716.78
7.4.280.0070.00016.71
7.4.270.0070.00016.81
7.4.260.0040.00416.79
7.4.250.0040.00416.66
7.4.240.0070.00016.82
7.4.230.0070.00016.89
7.4.220.0050.00216.53
7.4.210.0050.01216.79
7.4.200.0030.00316.89
7.4.160.0070.01116.72
7.4.140.0090.01017.86
7.4.130.0170.00316.78
7.4.120.0100.00816.78
7.3.330.0030.00313.47
7.3.320.0000.00613.38
7.3.310.0000.00616.53
7.3.300.0030.00316.55
7.3.290.0070.00016.58
7.3.280.0000.01516.59
7.3.260.0090.00716.58
7.3.240.0060.01316.64
7.2.30.0780.00817.98

preferences:
169.26 ms | 403 KiB | 5 Q