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"); $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")) > 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>"); } } } 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.70.0000.01516.88
8.3.60.0100.01018.31
8.3.50.0090.01321.21
8.3.40.0120.00318.98
8.3.30.0130.00718.82
8.3.20.0040.00419.02
8.3.10.0030.00520.79
8.3.00.0030.00619.51
8.2.180.0060.00916.88
8.2.170.0060.00922.96
8.2.160.0070.00722.26
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0060.00326.16
8.2.120.0000.00820.08
8.2.110.0040.00720.96
8.2.100.0060.00618.07
8.2.90.0040.00419.30
8.2.80.0050.00318.05
8.2.70.0070.00517.88
8.2.60.0030.00517.99
8.2.50.0000.00918.07
8.2.40.0000.00818.41
8.2.30.0040.00419.96
8.2.20.0040.00417.91
8.2.10.0040.00418.09
8.2.00.0080.00018.02
8.1.280.0120.00925.92
8.1.270.0050.00323.99
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0070.00322.57
8.1.230.0050.00520.86
8.1.220.0040.00418.77
8.1.210.0030.00619.07
8.1.200.0000.00917.61
8.1.190.0040.00417.66
8.1.180.0050.00318.10
8.1.170.0040.00418.95
8.1.160.0040.00419.04
8.1.150.0080.00018.77
8.1.140.0030.00517.55
8.1.130.0050.00217.98
8.1.120.0000.00817.66
8.1.110.0030.00517.70
8.1.100.0000.00717.68
8.1.90.0030.00517.66
8.1.80.0040.00417.56
8.1.70.0030.00317.63
8.1.60.0060.00317.78
8.1.50.0040.00417.47
8.1.40.0030.00617.71
8.1.30.0040.00417.80
8.1.20.0060.00317.77
8.1.10.0040.00417.67
8.1.00.0040.00417.75
8.0.300.0060.00320.07
8.0.290.0000.00816.75
8.0.280.0000.00818.61
8.0.270.0040.00417.47
8.0.260.0030.00317.10
8.0.250.0000.00717.17
8.0.240.0000.00717.13
8.0.230.0040.00417.22
8.0.220.0060.00317.22
8.0.210.0040.00417.04
8.0.200.0000.00717.13
8.0.190.0060.00317.14
8.0.180.0050.00317.05
8.0.170.0030.00617.02
8.0.160.0040.00417.25
8.0.150.0000.00817.14
8.0.140.0030.00617.02
8.0.130.0000.00613.53
8.0.120.0040.00417.17
8.0.110.0030.00617.04
8.0.100.0050.00317.12
8.0.90.0070.00017.18
8.0.80.0120.00917.13
8.0.70.0030.00617.16
8.0.60.0050.00217.11
8.0.50.0080.00017.16
8.0.30.0070.01217.31
8.0.20.0100.00917.40
8.0.10.0040.00417.34
8.0.00.0080.01417.17
7.4.330.0000.00513.43
7.4.320.0030.00316.77
7.4.300.0030.00316.61
7.4.290.0070.00416.80
7.4.280.0050.00316.70
7.4.270.0000.00716.66
7.4.260.0040.00413.39
7.4.250.0000.00716.50
7.4.240.0050.00316.80
7.4.230.0080.00016.41
7.4.220.0160.01016.80
7.4.210.0050.01016.67
7.4.200.0080.00016.85
7.4.190.0030.00316.81
7.4.160.0070.01516.72
7.4.150.0030.01417.40
7.4.140.0070.01017.19
7.4.130.0110.01016.70
7.4.120.0140.00416.70
7.4.110.0060.01316.73
7.4.100.0150.00616.76
7.4.90.0110.00816.79
7.4.80.0100.01019.03
7.4.70.0180.00616.74
7.4.60.0060.00916.74
7.4.50.0030.00616.69
7.4.40.0090.00622.27
7.4.30.0070.01416.90
7.4.00.0080.00614.98
7.3.330.0050.00213.55
7.3.320.0000.00613.43
7.3.310.0080.00016.55
7.3.300.0040.00416.49
7.3.290.0030.01116.46
7.3.280.0020.01316.53
7.3.270.0090.00917.40
7.3.260.0100.01218.24
7.3.250.0080.01316.64
7.3.240.0130.00916.75
7.3.230.0130.00316.47
7.3.210.0150.00316.62
7.3.200.0100.00719.39
7.3.190.0060.01216.70
7.3.180.0120.00416.65
7.3.170.0100.00616.75
7.3.160.0140.00716.73
7.3.120.0070.00715.15
7.2.330.0170.01316.84
7.2.320.0070.01116.94
7.2.310.0130.01316.96
7.2.300.0130.01016.70
7.2.290.0100.00717.02
7.1.70.0050.00517.33
7.1.60.0070.01719.40
7.1.50.0100.00617.20
7.1.00.0070.06022.31
7.0.200.0170.01014.83
7.0.140.0030.07022.10
7.0.100.0070.04321.83
7.0.90.0070.07321.93
7.0.80.0170.07021.78
7.0.70.0130.08321.93
7.0.60.0100.07721.66
7.0.50.0070.08722.11
7.0.40.0130.07019.96
7.0.30.0200.06320.17
7.0.20.0070.08320.08
7.0.10.0070.07720.03
7.0.00.0070.05720.04
5.6.280.0070.07320.93
5.6.250.0070.04720.64
5.6.240.0070.08320.61
5.6.230.0100.06320.67
5.6.220.0070.07320.54
5.6.210.0000.05720.66
5.6.200.0000.09021.09
5.6.190.0030.09321.13
5.6.180.0070.08321.11
5.6.170.0230.06020.98
5.6.160.0100.06021.01
5.6.150.0000.08721.04
5.6.140.0000.05021.07
5.6.130.0000.08721.18
5.6.120.0030.05320.95
5.6.110.0130.07321.05
5.6.100.0100.05021.05
5.6.90.0070.08720.97
5.6.80.0130.07720.34
5.6.70.0030.06720.42
5.6.60.0100.07720.47
5.6.50.0070.08020.41
5.6.40.0170.07020.34
5.6.30.0070.06720.38
5.6.20.0100.08320.32
5.6.10.0030.07020.43
5.6.00.0070.06020.39
5.5.380.0170.06720.46
5.5.370.0070.08320.37
5.5.360.0000.08720.36
5.5.350.0100.08020.46
5.5.340.0070.04020.91
5.5.330.0070.08020.86
5.5.320.0170.07020.91
5.5.310.0070.08320.80
5.5.300.0100.07320.94
5.5.290.0030.09020.92
5.5.280.0100.08720.88
5.5.270.0130.05020.94
5.5.260.0030.08020.75
5.5.250.0070.07720.61
5.5.240.0030.08320.16
5.5.230.0070.06020.31
5.5.220.0130.07020.26
5.5.210.0170.06720.20
5.5.200.0030.08320.27
5.5.190.0100.07020.27
5.5.180.0070.06320.23
5.5.160.0030.05020.02
5.5.150.0130.07720.27
5.5.140.0030.07720.25
5.5.130.0100.07020.23
5.5.120.0100.04020.29
5.5.110.0100.08020.24
5.5.100.0030.04720.18
5.5.90.0100.07319.99
5.5.80.0100.06720.11
5.5.70.0170.07319.98
5.5.60.0070.05320.05
5.5.50.0170.06720.11
5.5.40.0030.07020.18
5.5.30.0070.07320.07
5.5.20.0070.07720.16
5.5.10.0030.08320.04
5.5.00.0030.08320.05
5.4.450.0070.05719.37
5.4.440.0030.06019.18
5.4.430.0030.08719.26
5.4.420.0130.07719.41
5.4.410.0230.06319.04
5.4.400.0030.08318.90
5.4.390.0030.07019.18
5.4.380.0100.06319.10
5.4.370.0030.07719.03
5.4.360.0000.08319.04
5.4.350.0070.07319.09
5.4.340.0070.07718.90
5.4.320.0000.08318.88
5.4.310.0130.06719.03
5.4.300.0000.08019.12
5.4.290.0030.04719.04
5.4.280.0200.06318.85
5.4.270.0030.08319.16
5.4.260.0130.07319.00
5.4.250.0070.07019.02
5.4.240.0070.04719.08
5.4.230.0100.07319.04
5.4.220.0100.06318.84
5.4.210.0070.07319.20
5.4.200.0100.07319.08
5.4.190.0100.07719.04
5.4.180.0070.05719.04
5.4.170.0030.05019.12
5.4.160.0070.07019.19
5.4.150.0000.05318.88
5.4.140.0030.07316.40
5.4.130.0070.06716.37
5.4.120.0070.06716.29
5.4.110.0030.07716.39
5.4.100.0070.03316.37
5.4.90.0000.04016.37
5.4.80.0070.08016.35
5.4.70.0000.04716.47
5.4.60.0030.04716.49
5.4.50.0000.07016.45
5.4.40.0070.07316.30
5.4.30.0100.07016.43
5.4.20.0000.04316.26
5.4.10.0100.06716.38
5.4.00.0030.06315.74
5.3.290.0070.07714.83
5.3.280.0030.08014.73
5.3.270.0070.07014.70
5.3.260.0100.05314.62
5.3.250.0100.07714.69
5.3.240.0070.06714.71
5.3.230.0100.05014.59
5.3.220.0030.06314.61
5.3.210.0100.08014.69
5.3.200.0030.05314.65
5.3.190.0170.06314.58
5.3.180.0100.07314.49
5.3.170.0070.06014.60
5.3.160.0070.08314.54
5.3.150.0100.07314.62
5.3.140.0070.07714.69
5.3.130.0070.07714.66
5.3.120.0070.05714.55
5.3.110.0000.05714.68
5.3.100.0070.06314.04
5.3.90.0070.07314.05
5.3.80.0070.07313.94
5.3.70.0030.06714.02
5.3.60.0130.05714.08
5.3.50.0030.07013.91
5.3.40.0070.07313.91
5.3.30.0100.07014.07
5.3.20.0100.06713.79
5.3.10.0030.05013.75
5.3.00.0030.07013.70
5.2.170.0000.06711.11
5.2.160.0100.04711.18
5.2.150.0000.07011.09
5.2.140.0030.06711.23
5.2.130.0030.06011.20
5.2.120.0070.05711.18
5.2.110.0070.06011.22
5.2.100.0000.06311.14
5.2.90.0100.05011.20
5.2.80.0030.06011.16
5.2.70.0030.06711.25
5.2.60.0030.06311.10
5.2.50.0070.05311.11
5.2.40.0000.07011.09
5.2.30.0070.05710.91
5.2.20.0070.05710.98
5.2.10.0100.05010.98
5.2.00.0070.06010.81
5.1.60.0000.06010.12
5.1.50.0030.0579.87
5.1.40.0000.05710.06
5.1.30.0000.06010.28
5.1.20.0100.05010.44
5.1.10.0070.0539.94
5.1.00.0030.05310.14
5.0.50.0070.0409.17
5.0.40.0000.0379.17
5.0.30.0070.0609.17
5.0.20.0000.0339.17
5.0.10.0030.0439.17
5.0.00.0030.0639.17
4.4.90.0030.0379.17
4.4.80.0070.0239.17
4.4.70.0030.0209.17
4.4.60.0000.0339.17
4.4.50.0000.0339.17
4.4.40.0030.0379.17
4.4.30.0100.0339.17
4.4.20.0030.0379.17
4.4.10.0030.0339.17
4.4.00.0000.0579.17
4.3.110.0000.0339.17
4.3.100.0000.0379.17
4.3.90.0030.0339.17
4.3.80.0000.0539.17
4.3.70.0070.0279.17
4.3.60.0030.0309.17
4.3.50.0000.0339.17
4.3.40.0000.0479.17
4.3.30.0000.0239.17
4.3.20.0030.0309.17
4.3.10.0000.0179.17
4.3.00.0000.0279.17

preferences:
49.02 ms | 401 KiB | 5 Q