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; echo '$day: ' . $day ."\n"; $dateWeek = date("W", mktime(0, 0, 0, $month, $day, $year)); echo '$dateWeek: ' . $dateWeek ."\n"; if (intval(date("W")) > intval($dateWeek)) { echo "CONTINUE1\n"; 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(date("W", strtotime("+28 day"))) < intval(date("W"))) { $utolsoJelentkezhetoHet += 52; } echo "utolsoJelentkezhetoHet: " .$utolsoJelentkezhetoHet. "\n"; if (intval($dateWeek) > $utolsoJelentkezhetoHet) { $kellenekUresNapokAHonapVegen = false; echo "CONTINUE2\n"; 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.60.0120.00918.68
8.3.50.0090.00821.99
8.3.40.0160.00019.00
8.3.30.0070.00719.17
8.3.20.0040.00420.34
8.3.10.0100.00323.68
8.3.00.0040.00420.94
8.2.180.0090.00617.13
8.2.170.0180.00022.96
8.2.160.0120.00620.55
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0140.00426.16
8.2.120.0060.00320.98
8.2.110.0100.00022.38
8.2.100.0030.01019.89
8.2.90.0030.00519.47
8.2.80.0060.00318.13
8.2.70.0040.00418.00
8.2.60.0130.00018.04
8.2.50.0040.00718.13
8.2.40.0000.00820.13
8.2.30.0080.00018.59
8.2.20.0030.00518.03
8.2.10.0030.00518.40
8.2.00.0040.00418.07
8.1.280.0120.00325.92
8.1.270.0120.00323.97
8.1.260.0070.00726.35
8.1.250.0060.00328.09
8.1.240.0090.00023.96
8.1.230.0090.00319.37
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0090.00017.73
8.1.190.0060.00317.73
8.1.180.0030.00618.10
8.1.170.0100.00018.89
8.1.160.0040.00422.17
8.1.150.0060.00318.95
8.1.140.0040.00417.70
8.1.130.0030.00318.00
8.1.120.0040.00417.82
8.1.110.0040.00417.70
8.1.100.0050.00317.82
8.1.90.0030.00517.76
8.1.80.0040.00417.70
8.1.70.0040.00417.70
8.1.60.0030.00717.75
8.1.50.0090.00017.76
8.1.40.0040.00417.83
8.1.30.0040.00417.76
8.1.20.0030.00517.83
8.1.10.0040.00417.92
8.1.00.0040.00417.85
8.0.300.0070.00018.77
8.0.290.0050.00317.43
8.0.280.0070.00018.65
8.0.270.0040.00417.54
8.0.260.0000.00817.48
8.0.250.0040.00417.41
8.0.240.0030.00317.41
8.0.230.0030.00517.34
8.0.220.0000.00717.27
8.0.210.0060.00317.25
8.0.200.0030.00317.37
8.0.190.0040.00417.38
8.0.180.0040.00417.38
8.0.170.0060.00317.23
8.0.160.0000.00817.25
8.0.150.0000.00717.29
8.0.140.0050.00317.32
8.0.130.0060.00013.66
8.0.120.0090.00017.37
8.0.110.0080.00017.22
8.0.100.0050.00217.27
8.0.90.0040.00417.41
8.0.80.0130.00317.19
8.0.70.0000.00817.27
8.0.60.0040.00417.26
8.0.50.0030.00617.28
8.0.30.0160.00317.56
8.0.20.0180.00717.51
8.0.10.0040.00417.42
8.0.00.0100.00816.95
7.4.330.0030.00315.23
7.4.320.0050.00216.87
7.4.300.0000.00716.79
7.4.290.0050.00216.80
7.4.280.0000.00916.77
7.4.270.0000.00716.85
7.4.260.0070.00016.86
7.4.250.0040.00416.75
7.4.240.0030.00516.85
7.4.230.0070.00016.75
7.4.220.0100.00716.75
7.4.210.0060.01316.90
7.4.200.0070.00016.68
7.4.160.0090.00916.61
7.4.150.0130.00617.40
7.4.140.0120.00917.86
7.4.130.0080.01116.88
7.4.120.0080.01016.77
7.4.110.0070.01717.00
7.4.100.0140.01116.88
7.4.90.0060.01616.86
7.4.80.0180.00819.39
7.4.70.0110.01116.93
7.4.60.0090.00916.95
7.4.50.0000.00716.79
7.4.40.0090.00916.86
7.4.30.0070.01016.83
7.4.00.0110.00415.42
7.3.330.0000.00613.41
7.3.320.0050.00313.38
7.3.310.0040.00416.69
7.3.300.0000.00816.54
7.3.290.0000.01416.78
7.3.280.0040.01316.68
7.3.270.0090.00917.40
7.3.260.0240.00616.93
7.3.250.0120.01016.94
7.3.240.0060.01216.90
7.3.230.0070.01016.79
7.3.210.0110.00716.76
7.3.200.0100.00719.39
7.3.190.0140.00316.84
7.3.180.0120.00416.82
7.3.170.0080.00816.77
7.3.160.0110.00416.83
7.3.120.0040.01114.98
7.2.330.0080.00816.98
7.2.320.0050.01216.81
7.2.310.0060.01116.75
7.2.300.0000.01616.83
7.2.290.0120.00717.11
7.2.60.0000.01317.13
7.2.00.0050.00519.43
7.1.200.0060.00616.21
7.1.100.0030.01218.22
7.1.70.0000.01117.34
7.1.60.0060.01919.70
7.1.50.0100.01317.05
7.1.00.0000.08022.35
7.0.200.0000.00716.66
7.0.140.0030.07022.15
7.0.100.0230.08020.04
7.0.90.0170.08020.00
7.0.80.0130.08319.97
7.0.70.0170.04719.99
7.0.60.0100.06020.03
7.0.50.0070.08020.36
7.0.40.0070.04020.00
7.0.30.0030.05020.05
7.0.20.0030.05320.10
7.0.10.0030.04020.17
7.0.00.0030.04320.10
5.6.280.0030.07021.11
5.6.250.0100.07720.58
5.6.240.0070.09320.59
5.6.230.0030.08020.52
5.6.220.0070.04720.54
5.6.210.0070.07320.77
5.6.200.0100.07720.98
5.6.190.0130.04321.07
5.6.180.0130.03321.15
5.6.170.0030.05021.05
5.6.160.0070.04021.13
5.6.150.0030.07321.18
5.6.140.0030.04321.18
5.6.130.0100.06321.07
5.6.120.0070.04021.04
5.6.110.0000.04321.00
5.6.100.0000.04021.13
5.6.90.0100.03721.01
5.6.80.0030.04020.42
5.6.70.0100.03320.34
5.6.60.0070.03020.52
5.6.50.0000.04020.39
5.6.40.0070.04020.54
5.6.30.0030.03320.51
5.6.20.0070.03720.39
5.6.10.0070.03720.38
5.6.00.0030.04020.53
5.5.380.0070.05320.43
5.5.370.0070.08320.46
5.5.360.0000.08720.37
5.5.350.0070.08320.40
5.5.340.0200.05320.89
5.5.330.0030.06020.91
5.5.320.0030.04020.77
5.5.310.0070.03020.90
5.5.300.0030.04020.77
5.5.290.0170.03320.90
5.5.280.0070.04020.66
5.5.270.0000.04320.92
5.5.260.0100.04320.80
5.5.250.0100.05720.74
5.5.240.0100.03320.26
5.5.230.0100.02720.31
5.5.220.0000.03320.19
5.5.210.0130.03020.30
5.5.200.0000.05720.29
5.5.190.0070.03320.30
5.5.180.0030.03320.26
5.5.160.0030.04720.25
5.5.150.0000.04320.09
5.5.140.0070.03720.19
5.5.130.0030.03720.30
5.5.120.0070.06720.10
5.5.110.0130.06020.25
5.5.100.0070.08020.04
5.5.90.0100.07020.12
5.5.80.0130.07320.11
5.5.70.0170.05720.08
5.5.60.0070.08020.10
5.5.50.0000.07320.16
5.5.40.0070.08319.97
5.5.30.0070.07320.10
5.5.20.0100.08320.14
5.5.10.0130.07720.03
5.5.00.0100.04720.11
5.4.450.0000.04319.23
5.4.440.0070.03719.39
5.4.430.0000.04019.41
5.4.420.0100.02719.38
5.4.410.0030.04319.26
5.4.400.0070.03019.09
5.4.390.0000.04018.94
5.4.380.0030.04719.12
5.4.370.0070.03019.12
5.4.360.0030.06019.23
5.4.350.0070.05019.12
5.4.340.0030.03718.94
5.4.320.0070.07018.94
5.4.310.0100.04718.79
5.4.300.0070.04019.12
5.4.290.0000.04018.78
5.4.280.0000.04019.09
5.4.270.0070.03319.11
5.4.260.0030.03718.98
5.4.250.0030.05319.22
5.4.240.0130.06318.97
5.4.230.0130.06718.97
5.4.220.0130.07019.08
5.4.210.0130.06319.02
5.4.200.0070.07719.06
5.4.190.0030.08318.80
5.4.180.0030.05719.02
5.4.170.0130.06718.99
5.4.160.0100.03318.94
5.4.150.0070.06019.04
5.4.140.0070.07016.32
5.4.130.0030.04016.41
5.4.120.0100.03316.42
5.4.110.0030.04316.47
5.4.100.0030.04316.30
5.4.90.0030.07016.47
5.4.80.0030.04016.44
5.4.70.0100.05016.38
5.4.60.0030.06716.21
5.4.50.0030.05716.25
5.4.40.0130.06316.29
5.4.30.0070.07016.28
5.4.20.0000.06316.29
5.4.10.0100.06316.41
5.4.00.0100.06315.82
5.3.290.0030.03714.65
5.3.280.0130.06714.63
5.3.270.0030.08014.63
5.3.260.0070.07714.58
5.3.250.0030.03714.47
5.3.240.0100.07014.63
5.3.230.0030.07314.46
5.3.220.0070.07714.43
5.3.210.0000.05014.58
5.3.200.0070.08014.56
5.3.190.0100.04014.52
5.3.180.0030.05714.45
5.3.170.0030.03714.43
5.3.160.0130.07014.58
5.3.150.0130.03714.54
5.3.140.0170.06314.57
5.3.130.0030.06714.52
5.3.120.0070.07714.55
5.3.110.0030.04714.44
5.3.100.0100.06013.99
5.3.90.0030.04313.89
5.3.80.0070.07014.00
5.3.70.0100.07313.99
5.3.60.0130.07014.02
5.3.50.0100.05713.91
5.3.40.0030.07713.74
5.3.30.0030.05713.95
5.3.20.0030.04313.48
5.3.10.0030.05313.63
5.3.00.0100.06713.61
5.2.170.0070.03711.02
5.2.160.0030.05710.99
5.2.150.0100.04311.20
5.2.140.0030.04310.96
5.2.130.0030.04711.09
5.2.120.0030.03710.98
5.2.110.0100.04710.93
5.2.100.0030.03311.17
5.2.90.0100.04311.16
5.2.80.0000.05010.98
5.2.70.0170.04311.18
5.2.60.0170.05010.87
5.2.50.0170.04010.89
5.2.40.0100.06010.88
5.2.30.0100.04310.92
5.2.20.0030.06010.85
5.2.10.0070.05311.02
5.2.00.0130.05010.75
5.1.60.0000.05710.04
5.1.50.0030.03010.07
5.1.40.0030.05710.00
5.1.30.0030.05310.37
5.1.20.0070.05710.33
5.1.10.0030.02710.09
5.1.00.0000.05710.10
5.0.50.0070.0378.59
5.0.40.0100.0178.54
5.0.30.0070.0478.27
5.0.20.0070.0238.33
5.0.10.0000.0378.32
5.0.00.0030.0678.04
4.4.90.0000.0377.08
4.4.80.0030.0337.08
4.4.70.0000.0377.08
4.4.60.0000.0377.08
4.4.50.0000.0207.08
4.4.40.0030.0477.08
4.4.30.0030.0237.08
4.4.20.0130.0107.08
4.4.10.0030.0337.08
4.4.00.0070.0337.08
4.3.110.0000.0377.08
4.3.100.0070.0307.08
4.3.90.0030.0337.08
4.3.80.0070.0477.08
4.3.70.0030.0337.08
4.3.60.0000.0307.08
4.3.50.0070.0277.08
4.3.40.0030.0277.08
4.3.30.0000.0377.08
4.3.20.0030.0277.08
4.3.10.0000.0377.08
4.3.00.0000.0177.08

preferences:
42.05 ms | 401 KiB | 5 Q