3v4l.org

run code in 300+ PHP versions simultaneously
<?php $currentMonth = date("n"); $currentYear = date("Y"); echo $currentMonth . "\n"; echo $currentYear . "\n"; $month = $currentMonth; $year = $currentYear; $firstDayOfTheMonth = mktime(0, 0, 0, $month, 1, $year); $d = getdate($firstDayOfTheMonth); // Vasarnap helyett hetfo az elso nap a heten. $dayOfTheWeekOfFirstDayOfTheMonth = (6 + $d["wday"]) % 7 + 1; $totalDaysInCurrentMonth = date("t"); $kellenekUresNapokAHonapVegen = true; echo $firstDayOfTheMonth . "firstDayOfTheMonth\n"; //echo $d . "d\n"; echo $dayOfTheWeekOfFirstDayOfTheMonth . "dayOfTheWeekOfFirstDayOfTheMonth\n"; echo $totalDaysInCurrentMonth . "totalDaysInCurrentMonth\n"; for ($i = 0; $i < $totalDaysInCurrentMonth + ($dayOfTheWeekOfFirstDayOfTheMonth - 1); $i++) { // Csak az aktuális héttől kezdve. Megjegyzés: date("W") hétfőt tekinti a hét első napjának, ami nekünk pont megfelel. $day = $i - $dayOfTheWeekOfFirstDayOfTheMonth + 2; $dateWeek = date("W", mktime(0, 0, 0, $month, $day, $year)); if (intval(date("W")) > intval($dateWeek)) { continue; } // A hónap végén azokat a heteket nem jelenítjük meg, amikre még nem lehetne jelentkezni. $utolsoJelentkezhetoHet = intval(date("W", strtotime("+ 28 day"))); if (intval($dateWeek) > $utolsoJelentkezhetoHet) { $kellenekUresNapokAHonapVegen = false; continue; } if ($i % 7 == 0) { echo "<tr>"; } if ($i < $dayOfTheWeekOfFirstDayOfTheMonth - 1) { // Ures napok a honap elejen. echo "<td class='noborder'></td>"; } else if ($i < $totalDaysInCurrentMonth + $dayOfTheWeekOfFirstDayOfTheMonth - 1){ // Naptari napok. $day = $i - $dayOfTheWeekOfFirstDayOfTheMonth + 2; $date = date("Y-m-d", mktime(0, 0, 0, $month, $day, $year)); $napiJelentkezok = isset($napiJelentkezokSzama[$date]) ? $napiJelentkezokSzama[$date] : 0; if (isset($jelentkezettNapok[$date])) { if (isDayInTheFuture($date)) { echo "<td title='Klikkelj a lemondáshoz' id='nap-".$date."' class='registered' onclick='lemondasMegerositese(\"".$date."\")'><span class='notToday'>".$day."</span>".getNapiJelentkezokHtml($napiJelentkezok)."</td>"; } else { if (isToday($date)) { echo "<td id='nap-".$date."' class='todayRegistered today'><span class='today'>".$day."</span>".getNapiJelentkezokHtml($napiJelentkezok)."</td>"; } else { echo "<td id='nap-".$date."' class='pastRegistered'><span class='notToday'>".$day."</span>".getNapiJelentkezokHtml($napiJelentkezok)."</td>"; } } } else { if (isToday($date)) { echo "<td id='nap-".$date."' class='notAvailableForRegistration today'><span class='today'>".$day."</span>".getNapiJelentkezokHtml($napiJelentkezok)."</td>"; } else { echo "<td title='Klikkelj a jelentkezéshez' id='nap-".$date."' " .(isDayAvailableForRegistration($date, $jelentkezettNapok) ? "class='availableForRegistration' onclick='jelentkezesMegerositese(\"".$date."\")'><span class='notToday'>".$day."</span>".getNapiJelentkezokHtml($napiJelentkezok)."</td>" : "class='notAvailableForRegistration'><span class='notToday'>".$day."</span></td>"); } } } else { // TODO(palinko): Kell ez? echo "<td class='noborder'></td>"; } if ($i % 7 == 6) { echo "</tr>"; } } ?>

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.70.0100.01018.43
8.3.60.0120.00316.50
8.3.50.0090.00922.12
8.3.40.0060.00919.04
8.3.30.0110.00419.22
8.3.20.0090.00920.38
8.3.10.0070.00723.48
8.3.00.0000.00820.66
8.2.190.0120.00316.58
8.2.180.0120.00316.62
8.2.170.0120.00622.96
8.2.160.0140.00022.08
8.2.150.0090.00024.18
8.2.140.0090.00024.66
8.2.130.0080.01126.16
8.2.120.0040.00422.32
8.2.110.0000.01219.58
8.2.100.0060.00618.28
8.2.90.0000.00819.64
8.2.80.0090.00018.13
8.2.70.0000.00817.88
8.2.60.0040.00418.28
8.2.50.0060.00318.07
8.2.40.0080.00019.63
8.2.30.0030.00518.41
8.2.20.0040.00418.19
8.2.10.0080.00019.83
8.2.00.0060.00318.22
8.1.280.0090.00625.92
8.1.270.0070.00023.96
8.1.260.0080.00026.35
8.1.250.0160.00328.09
8.1.240.0000.00921.55
8.1.230.0040.00817.83
8.1.220.0000.00817.89
8.1.210.0000.00818.77
8.1.200.0000.01117.60
8.1.190.0000.00817.60
8.1.180.0040.00418.10
8.1.170.0030.00618.77
8.1.160.0050.00322.15
8.1.150.0000.00818.99
8.1.140.0080.00017.86
8.1.130.0030.00317.98
8.1.120.0040.00417.61
8.1.110.0050.00317.65
8.1.100.0050.00317.77
8.1.90.0070.00017.79
8.1.80.0070.00017.81
8.1.70.0030.00317.73
8.1.60.0040.00417.92
8.1.50.0000.00817.81
8.1.40.0040.00417.70
8.1.30.0040.00417.89
8.1.20.0040.00417.97
8.1.10.0030.00617.82
8.1.00.0040.00417.86
8.0.300.0000.00818.77
8.0.290.0070.00017.00
8.0.280.0040.00418.74
8.0.270.0090.00317.48
8.0.260.0030.00317.23
8.0.250.0030.00317.40
8.0.240.0060.00317.32
8.0.230.0000.00717.34
8.0.220.0040.00417.21
8.0.210.0080.00017.30
8.0.200.0030.00317.35
8.0.190.0070.00017.38
8.0.180.0040.00417.21
8.0.170.0000.00817.34
8.0.160.0080.00017.28
8.0.150.0000.00717.37
8.0.140.0080.00017.25
8.0.130.0000.00713.64
8.0.120.0060.00317.29
8.0.110.0040.00417.29
8.0.100.0030.00617.13
8.0.90.0040.00417.33
8.0.80.0140.00417.22
8.0.70.0000.00817.13
8.0.60.0040.00417.27
8.0.50.0000.00717.41
8.0.30.0130.01117.44
8.0.20.0090.01117.51
8.0.10.0040.00417.22
8.0.00.0050.01417.31
7.4.330.0000.00515.32
7.4.320.0030.00316.84
7.4.300.0030.00316.86
7.4.290.0000.00816.69
7.4.280.0040.00416.78
7.4.270.0000.00716.72
7.4.260.0000.00716.86
7.4.250.0040.00416.89
7.4.240.0040.00416.80
7.4.230.0040.00416.97
7.4.220.0130.01316.98
7.4.210.0080.00916.88
7.4.200.0040.00416.86
7.4.190.0070.00016.76
7.4.160.0090.00616.70
7.4.150.0100.00717.40
7.4.140.0120.01317.86
7.4.130.0130.01116.86
7.4.120.0120.00516.90
7.4.110.0060.01216.89
7.4.100.0060.01716.93
7.4.90.0060.01516.91
7.4.80.0070.01116.56
7.4.70.0060.01316.68
7.4.60.0060.01116.82
7.4.50.0050.00516.96
7.4.40.0110.00322.77
7.4.30.0100.00916.79
7.4.00.0080.00515.34
7.3.330.0050.00013.36
7.3.320.0000.00513.32
7.3.310.0040.00416.65
7.3.300.0070.00016.63
7.3.290.0040.01216.65
7.3.280.0100.00916.58
7.3.270.0060.01517.40
7.3.260.0060.01216.71
7.3.250.0130.00516.75
7.3.240.0120.00616.67
7.3.230.0090.01316.81
7.3.210.0100.00716.73
7.3.200.0100.01319.39
7.3.190.0070.01016.65
7.3.180.0100.00716.63
7.3.170.0090.00616.65
7.3.160.0090.00616.71
7.3.120.0000.01214.88
7.3.10.0000.01417.17
7.3.00.0000.01416.86
7.2.330.0130.01016.77
7.2.320.0140.00716.85
7.2.310.0000.01616.77
7.2.300.0050.01417.09
7.2.290.0150.00317.08
7.2.130.0040.01216.97
7.2.120.0040.01117.27
7.2.110.0110.00516.86
7.2.100.0060.01016.89
7.2.90.0090.00617.17
7.2.80.0030.01017.12
7.2.70.0030.00717.34
7.2.60.0090.01017.13
7.2.50.0160.00017.11
7.2.40.0080.00417.36
7.2.30.0080.00617.30
7.2.20.0040.00717.15
7.2.10.0040.01217.02
7.2.00.0030.01018.54
7.1.250.0030.00916.03
7.1.100.0080.00418.02
7.1.70.0090.01217.43
7.1.60.0140.01119.22
7.1.50.0000.01017.21
7.1.00.0070.07322.41
7.0.200.0040.00716.79
7.0.140.0070.06722.07
7.0.120.0000.07722.14
7.0.110.0070.07022.14
7.0.100.0100.06322.03
7.0.90.0070.06322.13
7.0.80.0070.07022.14
7.0.70.0070.07022.03
7.0.60.0000.06022.05
7.0.50.0100.06722.16
7.0.40.0030.07322.18
7.0.30.0030.07322.11
7.0.20.0030.07322.03
7.0.10.0000.07322.04
7.0.00.0100.06722.20
5.6.280.0030.07321.14
5.6.260.0100.06720.86
5.6.250.0000.06720.97
5.6.240.0070.07720.95
5.6.230.0000.08020.81
5.6.220.0030.06020.83
5.6.210.0100.06720.98
5.6.200.0070.05720.85
5.6.190.0070.07321.05
5.6.180.0000.07020.85
5.6.170.0030.07321.10
5.6.160.0070.07321.00
5.6.150.0000.07321.05
5.6.140.0030.07321.06
5.6.130.0000.07720.87
5.6.120.0000.07721.08
5.6.110.0030.07320.75
5.6.100.0000.08020.83
5.6.90.0070.06020.85
5.6.80.0070.06720.23
5.6.70.0030.06720.19
5.6.60.0000.05320.32
5.6.50.0100.06720.40
5.6.40.0130.05720.41
5.6.30.0030.07320.45
5.6.20.0070.06720.45
5.6.10.0030.07020.20
5.6.00.0030.06720.18
5.5.380.0030.07017.46
5.5.370.0030.07017.47
5.5.360.0000.07717.64
5.5.350.0070.05717.41
5.5.340.0030.07317.85
5.5.330.0000.07317.86
5.5.320.0070.06318.10
5.5.310.0030.07017.85
5.5.300.0070.07017.84
5.5.290.0030.07717.89
5.5.280.0070.07318.16
5.5.270.0030.07718.09
5.5.260.0000.07718.15
5.5.250.0030.06018.06
5.5.240.0000.07017.25
5.5.230.0000.07317.24
5.5.220.0030.05717.36
5.5.210.0000.06017.27
5.5.200.0000.07317.39
5.5.190.0000.06017.21
5.5.180.0030.07317.24
5.5.160.0070.06317.24
5.5.150.0070.05317.44
5.5.140.0000.07017.21
5.5.130.0030.05717.23
5.5.120.0000.06717.23
5.5.110.0070.06717.21
5.5.100.0070.06717.50
5.5.90.0000.07017.11
5.5.80.0030.06317.41
5.5.70.0070.06717.37
5.5.60.0000.06717.27
5.5.50.0000.06317.37
5.5.40.0070.06717.23
5.5.30.0070.06317.49
5.5.20.0000.07317.27
5.5.10.0000.07017.36
5.5.00.0100.06317.10
5.4.450.0000.07719.34
5.4.440.0030.07719.25
5.4.430.0030.07019.41
5.4.420.0070.06719.25
5.4.410.0030.06719.30
5.4.400.0030.06719.27
5.4.390.0000.07318.93
5.4.380.0070.06718.95
5.4.370.0070.06319.11
5.4.360.0000.06719.09
5.4.350.0000.06319.07
5.4.340.0000.07318.95
5.4.320.0070.06719.16
5.4.310.0000.06719.02
5.4.300.0000.07019.02
5.4.290.0000.07319.09
5.4.280.0030.07318.97
5.4.270.0030.06719.02
5.4.260.0000.07019.01
5.4.250.0030.06719.02
5.4.240.0030.06719.17
5.4.230.0030.07019.02
5.4.220.0000.07319.01
5.4.210.0000.07018.98
5.4.200.0070.06318.97
5.4.190.0000.06019.14
5.4.180.0100.06318.93
5.4.170.0030.07018.93
5.4.160.0030.06719.13
5.4.150.0030.07319.06
5.4.140.0000.07016.58
5.4.130.0000.06716.51
5.4.120.0000.06716.41
5.4.110.0000.07016.45
5.4.100.0030.06716.54
5.4.90.0000.06716.23
5.4.80.0030.06316.55
5.4.70.0030.06316.54
5.4.60.0000.06716.49
5.4.50.0000.06716.45
5.4.40.0070.06316.31
5.4.30.0030.06716.49
5.4.20.0030.06316.34
5.4.10.0070.06316.25
5.4.00.0070.06015.69
5.3.290.0030.06714.48
5.3.280.0070.06314.56
5.3.270.0000.07314.70
5.3.260.0070.06714.57
5.3.250.0000.07014.63
5.3.240.0030.06714.53
5.3.230.0000.07014.49
5.3.220.0000.07014.53
5.3.210.0030.07014.62
5.3.200.0000.07014.60
5.3.190.0070.06314.62
5.3.180.0100.06014.59
5.3.170.0030.06314.61
5.3.160.0030.06714.46
5.3.150.0030.06014.61
5.3.140.0000.07014.52
5.3.130.0030.07014.51
5.3.120.0030.07014.45
5.3.110.0030.07014.46
5.3.100.0030.06013.99
5.3.90.0030.06313.97
5.3.80.0030.06313.99
5.3.70.0030.05713.91
5.3.60.0000.05014.12
5.3.50.0070.05013.93
5.3.40.0000.07014.07
5.3.30.0000.06713.86
5.3.20.0000.06713.56
5.3.10.0000.06313.74
5.3.00.0000.05713.49
5.2.170.0000.06011.17
5.2.160.0070.05011.11
5.2.150.0000.06011.33
5.2.140.0070.05311.25
5.2.130.0000.05711.04
5.2.120.0000.05711.21
5.2.110.0070.04311.02
5.2.100.0000.05711.13
5.2.90.0030.05311.07
5.2.80.0000.05311.21
5.2.70.0000.05311.04
5.2.60.0030.05311.14
5.2.50.0000.05711.05
5.2.40.0000.05710.82
5.2.30.0000.06011.07
5.2.20.0000.05710.91
5.2.10.0030.05310.95
5.2.00.0000.05710.71
5.1.60.0070.04310.27
5.1.50.0000.04710.19
5.1.40.0000.04710.09
5.1.30.0070.04710.34
5.1.20.0000.05010.51
5.1.10.0000.05010.07
5.1.00.0000.05010.09
5.0.50.0070.0379.75
5.0.40.0000.0409.75
5.0.30.0000.0579.75
5.0.20.0030.0339.75
5.0.10.0030.0409.75
5.0.00.0070.0479.75
4.4.90.0000.0309.75
4.4.80.0000.0339.75
4.4.70.0030.0309.75
4.4.60.0030.0309.75
4.4.50.0000.0309.75
4.4.40.0000.0509.75
4.4.30.0000.0339.75
4.4.20.0000.0339.75
4.4.10.0000.0339.75
4.4.00.0000.0509.75
4.3.110.0030.0309.75
4.3.100.0000.0339.75
4.3.90.0030.0279.75
4.3.80.0000.0479.75
4.3.70.0030.0279.75
4.3.60.0030.0209.75
4.3.50.0000.0209.75
4.3.40.0000.0279.75
4.3.30.0000.0339.75
4.3.20.0030.0309.75
4.3.10.0000.0339.75
4.3.00.0030.0309.75

preferences:
43.71 ms | 401 KiB | 5 Q