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; } TODO */ // 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(12, 2012, 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.0110.01118.43
8.3.60.0150.00618.30
8.3.50.0150.00422.02
8.3.40.0080.00818.88
8.3.30.0120.00319.16
8.3.20.0070.00720.26
8.3.10.0080.00022.09
8.3.00.0080.00022.42
8.2.180.0110.01116.48
8.2.170.0110.00422.96
8.2.160.0100.01021.05
8.2.150.0090.00024.18
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0050.00319.61
8.2.110.0080.00320.71
8.2.100.0040.00818.16
8.2.90.0060.00319.47
8.2.80.0080.00017.98
8.2.70.0080.00018.00
8.2.60.0000.00818.05
8.2.50.0030.00618.07
8.2.40.0030.00518.46
8.2.30.0040.00418.13
8.2.20.0030.00618.08
8.2.10.0060.00319.84
8.2.00.0000.00918.16
8.1.280.0040.01125.92
8.1.270.0050.00323.91
8.1.260.0090.00026.35
8.1.250.0080.00028.09
8.1.240.0140.00422.27
8.1.230.0080.00319.08
8.1.220.0000.00817.91
8.1.210.0060.00318.77
8.1.200.0040.00417.60
8.1.190.0060.00317.48
8.1.180.0000.01018.10
8.1.170.0030.00618.72
8.1.160.0060.00322.06
8.1.150.0060.00318.80
8.1.140.0030.00517.73
8.1.130.0050.00218.07
8.1.120.0040.00417.71
8.1.110.0040.00417.70
8.1.100.0040.00417.72
8.1.90.0030.00717.79
8.1.80.0080.00017.70
8.1.70.0050.00317.71
8.1.60.0080.00017.69
8.1.50.0050.00317.71
8.1.40.0000.00917.79
8.1.30.0030.00617.76
8.1.20.0060.00317.78
8.1.10.0000.00817.80
8.1.00.0050.00317.78
8.0.300.0080.00020.21
8.0.290.0050.00317.00
8.0.280.0040.00418.51
8.0.270.0040.00417.32
8.0.260.0030.00317.16
8.0.250.0000.00717.31
8.0.240.0040.00417.18
8.0.230.0030.00317.17
8.0.220.0050.00317.13
8.0.210.0000.00717.19
8.0.200.0000.00717.25
8.0.190.0000.00917.29
8.0.180.0030.00617.29
8.0.170.0030.00517.17
8.0.160.0040.00417.24
8.0.150.0040.00417.14
8.0.140.0040.00417.19
8.0.130.0030.00313.64
8.0.120.0030.00617.16
8.0.110.0040.00417.11
8.0.100.0040.00417.13
8.0.90.0090.00017.29
8.0.80.0120.00317.21
8.0.70.0030.00617.04
8.0.60.0030.00517.18
8.0.50.0060.00317.13
8.0.30.0090.01417.37
8.0.20.0150.00917.40
8.0.10.0040.00417.39
8.0.00.0120.00917.04
7.4.330.0000.00515.21
7.4.320.0000.00716.70
7.4.300.0060.00016.63
7.4.290.0050.00216.62
7.4.280.0060.00316.80
7.4.270.0080.00016.69
7.4.260.0030.00316.61
7.4.250.0040.00416.74
7.4.240.0030.00416.70
7.4.230.0000.00716.75
7.4.220.0100.01716.81
7.4.210.0080.00916.79
7.4.200.0000.00716.66
7.4.190.0040.00416.99
7.4.160.0120.01216.83
7.4.150.0080.01217.40
7.4.140.0120.00717.86
7.4.130.0120.00816.84
7.4.120.0080.01516.89
7.4.110.0030.01616.78
7.4.100.0040.01716.83
7.4.90.0110.00716.94
7.4.80.0150.00916.88
7.4.70.0000.01716.88
7.4.60.0070.01016.81
7.4.50.0050.00316.64
7.4.40.0100.00722.77
7.4.30.0060.01216.74
7.4.00.0020.01515.21
7.3.330.0050.00013.38
7.3.320.0030.00313.54
7.3.310.0040.00416.59
7.3.300.0050.00216.56
7.3.290.0100.01416.54
7.3.280.0070.01016.59
7.3.270.0110.01117.40
7.3.260.0100.01016.88
7.3.250.0050.01416.77
7.3.240.0160.01016.71
7.3.230.0000.01716.63
7.3.210.0090.00916.61
7.3.200.0130.00819.39
7.3.190.0180.00616.88
7.3.180.0160.00616.87
7.3.170.0030.01916.95
7.3.160.0080.00916.79
7.3.120.0060.00915.21
7.3.110.0090.00915.18
7.3.100.0060.00615.29
7.3.90.0130.00615.13
7.3.80.0130.00315.14
7.3.70.0130.00014.96
7.3.60.0000.01415.15
7.3.50.0040.01115.27
7.3.40.0060.00314.93
7.3.30.0040.01115.18
7.3.20.0140.00317.05
7.3.10.0000.01616.77
7.3.00.0030.01417.04
7.2.330.0060.01216.87
7.2.320.0090.00916.79
7.2.310.0080.01116.89
7.2.300.0070.01017.01
7.2.290.0040.01417.06
7.2.250.0100.01015.51
7.2.240.0130.00715.22
7.2.230.0000.01715.62
7.2.220.0130.00015.53
7.2.210.0060.01015.23
7.2.200.0040.01115.36
7.2.190.0100.00715.18
7.2.180.0070.01115.48
7.2.170.0070.01015.16
7.2.00.0060.00919.74
7.1.330.0000.01516.19
7.1.320.0030.00616.02
7.1.310.0030.00915.82
7.1.300.0060.00915.96
7.1.290.0000.01416.14
7.1.280.0000.01515.96
7.1.270.0060.00616.21
7.1.260.0090.00615.94
7.1.100.0080.00818.42
7.1.70.0090.00617.12
7.1.60.0070.01719.82
7.1.50.0060.01517.30
7.1.00.0030.07722.36
7.0.200.0030.01017.02
7.0.140.0070.07022.22
7.0.100.0000.04720.00
7.0.90.0030.04319.94
7.0.80.0030.09020.16
7.0.70.0100.08019.89
7.0.60.0130.05020.03
7.0.50.0170.04020.34
7.0.40.0000.05320.04
7.0.30.0030.04320.13
7.0.20.0070.03720.15
7.0.10.0070.04020.09
7.0.00.0070.04320.04
5.6.280.0030.07721.03
5.6.250.0070.04720.55
5.6.240.0070.07320.51
5.6.230.0130.07020.69
5.6.220.0070.08320.69
5.6.210.0170.06320.63
5.6.200.0130.10021.01
5.6.190.0070.04021.03
5.6.180.0170.03721.02
5.6.170.0030.04321.06
5.6.160.0070.03721.00
5.6.150.0100.03721.03
5.6.140.0070.04021.05
5.6.130.0070.04020.97
5.6.120.0000.04320.97
5.6.110.0030.04721.05
5.6.100.0030.04021.04
5.6.90.0030.05321.04
5.6.80.0000.04320.43
5.6.70.0030.04020.34
5.6.60.0030.04320.43
5.6.50.0100.07020.46
5.6.40.0030.04320.39
5.6.30.0130.03320.48
5.6.20.0030.03720.50
5.6.10.0030.04020.50
5.6.00.0000.04320.32
5.5.380.0070.06320.44
5.5.370.0100.08020.40
5.5.360.0070.08320.47
5.5.350.0000.07020.43
5.5.340.0070.04020.90
5.5.330.0030.04320.82
5.5.320.0070.04020.84
5.5.310.0030.04320.88
5.5.300.0130.03320.89
5.5.290.0070.04020.66
5.5.280.0000.04720.82
5.5.270.0030.05020.76
5.5.260.0100.06320.65
5.5.250.0070.04020.60
5.5.240.0030.04020.28
5.5.230.0030.04320.29
5.5.220.0070.03720.03
5.5.210.0000.04720.23
5.5.200.0030.04020.15
5.5.190.0070.06720.13
5.5.180.0130.03320.20
5.5.160.0000.04720.25
5.5.150.0030.04020.00
5.5.140.0000.04320.22
5.5.130.0070.03720.19
5.5.120.0100.04020.26
5.5.110.0070.04320.20
5.5.100.0030.06020.12
5.5.90.0070.03720.17
5.5.80.0070.06319.96
5.5.70.0030.04320.10
5.5.60.0170.07319.95
5.5.50.0030.05320.02
5.5.40.0070.05320.11
5.5.30.0100.04020.07
5.5.20.0100.03320.11
5.5.10.0070.04720.13
5.5.00.0100.05720.14
5.4.450.0070.05319.46
5.4.440.0030.04019.20
5.4.430.0030.04319.27
5.4.420.0100.04019.20
5.4.410.0070.03719.38
5.4.400.0030.03719.04
5.4.390.0070.03019.23
5.4.380.0100.03319.12
5.4.370.0030.03719.24
5.4.360.0030.03718.95
5.4.350.0100.02718.88
5.4.340.0000.04319.03
5.4.320.0030.03719.23
5.4.310.0100.03718.85
5.4.300.0100.03319.04
5.4.290.0070.03319.13
5.4.280.0100.03318.84
5.4.270.0030.03719.03
5.4.260.0000.04719.04
5.4.250.0100.03719.04
5.4.240.0070.04319.20
5.4.230.0200.05719.04
5.4.220.0200.05019.02
5.4.210.0200.02719.13
5.4.200.0030.06718.87
5.4.190.0030.07019.02
5.4.180.0100.07318.87
5.4.170.0070.08319.13
5.4.160.0130.06318.89
5.4.150.0100.07719.11
5.4.140.0100.07016.33
5.4.130.0100.07316.41
5.4.120.0100.04016.50
5.4.110.0030.04716.38
5.4.100.0100.03716.48
5.4.90.0100.06016.51
5.4.80.0070.07316.34
5.4.70.0100.03716.41
5.4.60.0100.07016.34
5.4.50.0100.07016.33
5.4.40.0030.08016.52
5.4.30.0030.07716.30
5.4.20.0070.07316.43
5.4.10.0070.07316.25
5.4.00.0070.07315.86
5.3.290.0000.04314.61
5.3.280.0030.07714.76
5.3.270.0000.05014.63
5.3.260.0100.06314.60
5.3.250.0100.06314.54
5.3.240.0070.07314.69
5.3.230.0100.06714.62
5.3.220.0130.07014.72
5.3.210.0000.09014.64
5.3.200.0030.07714.54
5.3.190.0070.08314.64
5.3.180.0070.06714.64
5.3.170.0070.04314.61
5.3.160.0000.08314.53
5.3.150.0070.04714.67
5.3.140.0030.06014.56
5.3.130.0070.08314.50
5.3.120.0130.07714.63
5.3.110.0030.04314.66
5.3.100.0070.07714.13
5.3.90.0100.06714.02
5.3.80.0030.06014.04
5.3.70.0130.06014.09
5.3.60.0100.07014.05
5.3.50.0070.05314.02
5.3.40.0030.05014.03
5.3.30.0200.05714.04
5.3.20.0000.04013.63
5.3.10.0030.07313.81
5.3.00.0070.04713.54
5.2.170.0070.06311.32
5.2.160.0070.06011.32
5.2.150.0070.06311.32
5.2.140.0030.05311.32
5.2.130.0030.05011.32
5.2.120.0070.06011.32
5.2.110.0070.05311.32
5.2.100.0070.06011.32
5.2.90.0100.04311.32
5.2.80.0100.06011.32
5.2.70.0030.07011.32
5.2.60.0030.05711.32
5.2.50.0100.05711.32
5.2.40.0070.06011.32
5.2.30.0070.05711.32
5.2.20.0030.06711.32
5.2.10.0100.05311.32
5.2.00.0130.04711.32
5.1.60.0030.04011.32
5.1.50.0070.05011.32
5.1.40.0030.05711.32
5.1.30.0070.04011.32
5.1.20.0070.05711.32
5.1.10.0000.05711.32
5.1.00.0030.04011.32
5.0.50.0030.02011.32
5.0.40.0070.03711.32
5.0.30.0030.07011.32
5.0.20.0000.05011.32
5.0.10.0030.03711.32
5.0.00.0030.05711.32
4.4.90.0030.03011.32
4.4.80.0070.02711.32
4.4.70.0030.03311.32
4.4.60.0100.02711.32
4.4.50.0000.04011.32
4.4.40.0030.05311.32
4.4.30.0070.03311.32
4.4.20.0000.03311.32
4.4.10.0000.02011.32
4.4.00.0000.05011.32
4.3.110.0000.03711.32
4.3.100.0030.03311.32
4.3.90.0000.04011.32
4.3.80.0170.01711.32
4.3.70.0030.01311.32
4.3.60.0030.03711.32
4.3.50.0130.02711.32
4.3.40.0000.04311.32
4.3.30.0000.02311.32
4.3.20.0030.03711.32
4.3.10.0070.03011.32
4.3.00.0030.03311.32

preferences:
48.31 ms | 401 KiB | 5 Q