3v4l.org

run code in 300+ PHP versions simultaneously
<?php function drawMonth($month, $year, $jelentkezettNapok, $napiJelentkezokSzama) { // $months = Array("Január", "Február", "Március", "Április", "Május", "Június", "Július", // "Augusztus", "Szeptember", "Október", "November", "December"); //echo "<p class='honapNeve'>".$months[$month - 1]."</p>"; // echo "<table class='naptar'>"; // echo "<tr><th>H</th><th>K</th><th>Sz</th><th>Cs</th><th>P</th><th>Sz</th><th>V</th></tr>"; $firstDayOfTheMonth = mktime(0, 0, 0, $month, 1, $year); $d = getdate($firstDayOfTheMonth); // Vasarnap helyett hetfo az elso nap a heten. Pl. "6" jelentese: szombaton kezdodik a honap. $dayOfTheWeekOfFirstDayOfTheMonth = (6 + $d["wday"]) % 7 + 1; // Hany napos a honap. $totalDaysInCurrentMonth = date("t", $firstDayOfTheMonth); $kellenekUresNapokAHonapVegen = true; 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", $firstDayOfTheMonth)) > 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 ($utolsoJelentkezhetoHet < intval(date("W"))) { // Ez decemberben fordulhat elo, amikor is 28 nap mulva mar januarra esik. Ebben az esetben // az egesz honapot ki kell irni. $utolsoJelentkezhetoHet += 52; } // date("W", mktime(0, 0, 0, 12, 31, 2012)) hibasan 1-et ad 53 helyett, ezert a december // honapot kulon kell kezelni. if (!($month == 12 && $day >= 3) && 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>"); } }*/ echo $day . "nap "; } else { // TODO(palinko): Kell ez? echo "<td class='noborder'></td>"; } if ($i % 7 == 6) { echo "</tr>"; } } // Üres napok a hónap végén. Csak akkor, ha nem üres hetet (7 üres napot) kellene kiírni. // TODO(palinko): $kellenekUresNapokAHonapVegen-t helyesen számolni eredetileg is. if ($kellenekUresNapokAHonapVegen && ($totalDaysInCurrentMonth + ($dayOfTheWeekOfFirstDayOfTheMonth - 1)) % 7 > 0) { for ($i = ($totalDaysInCurrentMonth + ($dayOfTheWeekOfFirstDayOfTheMonth - 1)) % 7; $i < 7; $i++) { echo "<td class='noborder'></td>"; } } // echo "</table>"; } drawMonth(1, 2013, array(), array()); ?>

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.40.0090.00618.97
8.3.30.0150.00418.92
8.3.20.0060.00318.98
8.3.10.0040.00419.46
8.3.00.0080.00023.54
8.2.170.0090.00922.96
8.2.160.0080.01120.52
8.2.150.0030.00524.18
8.2.140.0080.00024.66
8.2.130.0000.00826.16
8.2.120.0030.00619.73
8.2.110.0070.00320.55
8.2.100.0040.00818.09
8.2.90.0000.00819.53
8.2.80.0030.00718.18
8.2.70.0070.00317.88
8.2.60.0030.00618.18
8.2.50.0030.00518.07
8.2.40.0040.00418.28
8.2.30.0040.00420.06
8.2.20.0040.00418.02
8.2.10.0060.00318.16
8.2.00.0040.00418.04
8.1.270.0050.00323.99
8.1.260.0100.00726.35
8.1.250.0040.00428.09
8.1.240.0050.00522.59
8.1.230.0000.01120.85
8.1.220.0000.00818.77
8.1.210.0050.00519.02
8.1.200.0030.00617.72
8.1.190.0060.00317.66
8.1.180.0030.00618.10
8.1.170.0030.00618.84
8.1.160.0040.00419.07
8.1.150.0000.00818.89
8.1.140.0080.00017.70
8.1.130.0060.00317.85
8.1.120.0030.00517.64
8.1.110.0040.00417.61
8.1.100.0000.00817.75
8.1.90.0050.00317.77
8.1.80.0000.00717.63
8.1.70.0040.00417.73
8.1.60.0000.00917.71
8.1.50.0000.00817.73
8.1.40.0000.00817.63
8.1.30.0000.00817.72
8.1.20.0040.00417.90
8.1.10.0030.00517.70
8.1.00.0060.00617.86
8.0.300.0040.00420.09
8.0.290.0080.00017.17
8.0.280.0000.00818.60
8.0.270.0000.00817.33
8.0.260.0050.00317.08
8.0.250.0050.00317.38
8.0.240.0060.00317.29
8.0.230.0050.00317.24
8.0.220.0040.00417.13
8.0.210.0030.00317.19
8.0.200.0030.00317.23
8.0.190.0030.00617.34
8.0.180.0040.00417.21
8.0.170.0040.00417.31
8.0.160.0000.00717.23
8.0.150.0040.00417.13
8.0.140.0000.00817.13
8.0.130.0030.00313.62
8.0.120.0040.00417.18
8.0.110.0000.01017.02
8.0.100.0000.00717.03
8.0.90.0080.00017.11
8.0.80.0000.01817.29
8.0.70.0030.00617.15
8.0.60.0040.00417.14
8.0.50.0000.00817.13
8.0.30.0090.01117.37
8.0.20.0130.01217.41
8.0.10.0000.00817.23
8.0.00.0070.01616.98
7.4.330.0000.00614.89
7.4.320.0030.00316.72
7.4.300.0080.00016.81
7.4.290.0070.00016.71
7.4.280.0050.00516.70
7.4.270.0070.00016.68
7.4.260.0050.00013.44
7.4.250.0030.00616.80
7.4.240.0000.00716.80
7.4.230.0000.00716.90
7.4.220.0130.00616.64
7.4.210.0110.00716.72
7.4.200.0030.00516.89
7.4.190.0040.00716.99
7.4.160.0110.00416.80
7.4.150.0100.01017.40
7.4.140.0140.00717.86
7.4.130.0090.01016.79
7.4.120.0060.01416.85
7.4.110.0090.00916.65
7.4.100.0060.01216.74
7.4.90.0050.01416.78
7.4.80.0150.00419.37
7.4.70.0090.00916.79
7.4.60.0120.00416.64
7.4.50.0030.00716.39
7.4.40.0040.00722.27
7.4.30.0160.00916.84
7.4.00.0130.00315.35
7.3.330.0000.00513.46
7.3.320.0030.00313.41
7.3.310.0000.00816.49
7.3.300.0030.00316.49
7.3.290.0000.01416.64
7.3.280.0050.01416.58
7.3.270.0160.00817.40
7.3.260.0140.00518.24
7.3.250.0090.01116.72
7.3.240.0110.00716.71
7.3.230.0030.01716.71
7.3.210.0070.01816.64
7.3.200.0090.00919.39
7.3.190.0130.01116.64
7.3.180.0140.00716.89
7.3.170.0130.00916.85
7.3.160.0070.01016.91
7.3.120.0060.00914.87
7.2.330.0220.01316.91
7.2.320.0100.01017.09
7.2.310.0210.03217.07
7.2.300.0090.00916.91
7.2.290.0060.01617.08
7.2.00.0030.01319.85
7.1.100.0060.00618.42
7.1.70.0030.00517.28
7.1.60.0130.01019.40
7.1.50.0100.01317.14
7.1.00.0000.04722.37
7.0.200.0050.00516.97
7.0.140.0000.08021.94
7.0.90.0470.07019.98
7.0.80.0470.07319.92
7.0.70.0200.04719.91
7.0.60.0170.07020.00
7.0.50.0030.08020.32
7.0.40.0030.08020.08
7.0.30.0100.06320.14
7.0.20.0130.03320.13
7.0.10.0070.10020.12
7.0.00.0070.08320.05
5.6.280.0070.07320.94
5.6.240.0130.07320.56
5.6.230.0000.06020.64
5.6.220.0070.04020.70
5.6.210.0170.04320.67
5.6.200.0030.07321.09
5.6.190.0130.07321.20
5.6.180.0130.08321.00
5.6.170.0130.08021.01
5.6.160.0030.08021.18
5.6.150.0100.05721.15
5.6.140.0030.09321.13
5.6.130.0100.07721.04
5.6.120.0130.08720.96
5.6.110.0070.08021.08
5.6.100.0100.08321.08
5.6.90.0130.08721.05
5.6.80.0100.06020.47
5.6.70.0130.05020.44
5.6.60.0070.06720.43
5.6.50.0100.07320.45
5.6.40.0130.05320.46
5.6.30.0070.08320.34
5.6.20.0070.08720.42
5.6.10.0170.07020.41
5.6.00.0100.08020.38
5.5.380.0070.05720.38
5.5.370.0070.08320.38
5.5.360.0070.04720.45
5.5.350.0030.09320.34
5.5.340.0070.09020.92
5.5.330.0170.07020.85
5.5.320.0200.06320.94
5.5.310.0130.07720.79
5.5.300.0070.08720.81
5.5.290.0030.03720.91
5.5.280.0100.08720.94
5.5.270.0130.08720.89
5.5.260.0070.08320.93
5.5.250.0100.08020.71
5.5.240.0170.06020.26
5.5.230.0130.07020.31
5.5.220.0100.08320.11
5.5.210.0070.07720.16
5.5.200.0030.09020.28
5.5.190.0070.08720.21
5.5.180.0130.08020.29
5.5.160.0130.07020.14
5.5.150.0130.05320.20
5.5.140.0070.07720.11
5.5.130.0130.04320.17
5.5.120.0200.07020.27
5.5.110.0100.04020.16
5.5.100.0100.06020.13
5.5.90.0030.04320.19
5.5.80.0070.04019.97
5.5.70.0030.08020.08
5.5.60.0070.08320.05
5.5.50.0070.07020.18
5.5.40.0100.07720.16
5.5.30.0030.04319.98
5.5.20.0100.05020.16
5.5.10.0130.06020.05
5.5.00.0030.07719.99
5.4.450.0000.03719.42
5.4.440.0170.07019.23
5.4.430.0130.07719.45
5.4.420.0070.07719.42
5.4.410.0030.08019.07
5.4.400.0000.08019.09
5.4.390.0130.07718.91
5.4.380.0070.06718.82
5.4.370.0000.08319.03
5.4.360.0030.09018.88
5.4.350.0030.09018.85
5.4.340.0170.06018.91
5.4.320.0030.08319.04
5.4.310.0100.03718.87
5.4.300.0070.07019.09
5.4.290.0000.07019.04
5.4.280.0030.05719.02
5.4.270.0070.07719.09
5.4.260.0170.06718.89
5.4.250.0070.07719.11
5.4.240.0130.07319.04
5.4.230.0030.07318.89
5.4.220.0400.04319.05
5.4.210.0070.07019.20
5.4.200.0070.06719.06
5.4.190.0100.07319.22
5.4.180.0030.08019.01
5.4.170.0070.08319.22
5.4.160.0030.08318.86
5.4.150.0130.06019.14
5.4.140.0030.07316.35
5.4.130.0030.07016.41
5.4.120.0030.08016.34
5.4.110.0000.08016.48
5.4.100.0070.06716.36
5.4.90.0070.06316.39
5.4.80.0100.06716.48
5.4.70.0070.04316.46
5.4.60.0100.02716.33
5.4.50.0100.07016.34
5.4.40.0030.08016.48
5.4.30.0130.03716.47
5.4.20.0100.05316.36
5.4.10.0130.07316.33
5.4.00.0200.06315.85
5.3.290.0100.08314.80
5.3.280.0070.06014.68
5.3.270.0070.04014.58
5.3.260.0070.08314.66
5.3.250.0100.07714.69
5.3.240.0000.04314.59
5.3.230.0030.07014.73
5.3.220.0030.08014.51
5.3.210.0070.07714.68
5.3.200.0070.03714.71
5.3.190.0030.07714.70
5.3.180.0000.07314.65
5.3.170.0130.07314.61
5.3.160.0030.08014.52
5.3.150.0030.08014.65
5.3.140.0130.06714.64
5.3.130.0030.06014.54
5.3.120.0000.07714.59
5.3.110.0070.06714.68
5.3.100.0100.06014.03
5.3.90.0130.07714.06
5.3.80.0070.06314.13
5.3.70.0030.05014.06
5.3.60.0070.08013.95
5.3.50.0000.06314.03
5.3.40.0070.05014.11
5.3.30.0130.06714.02
5.3.20.0070.07313.85
5.3.10.0100.06713.66
5.3.00.0030.06013.78
5.2.170.0030.04311.26
5.2.160.0030.05011.28
5.2.150.0030.04311.28
5.2.140.0000.07011.09
5.2.130.0100.05711.16
5.2.120.0100.06011.13
5.2.110.0070.06011.13
5.2.100.0030.03711.16
5.2.90.0030.05710.99
5.2.80.0070.06011.02
5.2.70.0030.04011.10
5.2.60.0030.03311.10
5.2.50.0030.03011.07
5.2.40.0000.07011.04
5.2.30.0030.06310.86
5.2.20.0030.06310.85
5.2.10.0070.04710.75
5.2.00.0100.05010.73
5.1.60.0030.03310.65
5.1.50.0030.05010.65
5.1.40.0000.05310.65
5.1.30.0030.04710.65
5.1.20.0030.03010.65
5.1.10.0070.02310.65
5.1.00.0100.05010.65
5.0.50.0000.04010.65
5.0.40.0030.04710.65
5.0.30.0000.05010.65
5.0.20.0000.03010.65
5.0.10.0000.04010.65
5.0.00.0030.04710.65
4.4.90.0070.03310.65
4.4.80.0030.01710.65
4.4.70.0030.03710.65
4.4.60.0070.01710.65
4.4.50.0070.01710.65
4.4.40.0070.04710.65
4.4.30.0030.02710.65
4.4.20.0000.04010.65
4.4.10.0100.03710.65
4.4.00.0070.04310.65
4.3.110.0000.04010.65
4.3.100.0030.03710.65
4.3.90.0100.01010.65
4.3.80.0000.06010.65
4.3.70.0000.02010.65
4.3.60.0030.03710.65
4.3.50.0000.02310.65
4.3.40.0030.03710.65
4.3.30.0030.03710.65
4.3.20.0000.04010.65
4.3.10.0100.02710.65
4.3.00.0000.04010.65

preferences:
61.71 ms | 400 KiB | 5 Q