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(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.60.0090.01216.75
8.3.50.0100.00722.11
8.3.40.0110.00418.77
8.3.30.0140.00019.26
8.3.20.0040.00420.29
8.3.10.0050.00223.53
8.3.00.0050.00320.54
8.2.180.0070.01718.66
8.2.170.0060.01022.96
8.2.160.0040.01122.30
8.2.150.0090.00024.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0000.00822.44
8.2.110.0060.00322.22
8.2.100.0040.00817.97
8.2.90.0050.00319.30
8.2.80.0000.00818.05
8.2.70.0030.00618.00
8.2.60.0000.00818.05
8.2.50.0060.00318.07
8.2.40.0050.00319.44
8.2.30.0040.00418.34
8.2.20.0040.00418.07
8.2.10.0080.00018.16
8.2.00.0000.00918.04
8.1.280.0140.00725.92
8.1.270.0080.00023.91
8.1.260.0000.00826.35
8.1.250.0000.00828.09
8.1.240.0060.00323.98
8.1.230.0100.00319.29
8.1.220.0030.00517.93
8.1.210.0000.00818.77
8.1.200.0060.00317.60
8.1.190.0000.00917.52
8.1.180.0030.00518.10
8.1.170.0060.00318.90
8.1.160.0040.00422.13
8.1.150.0040.00418.92
8.1.140.0040.00417.78
8.1.130.0060.00317.94
8.1.120.0000.00817.73
8.1.110.0040.00417.78
8.1.100.0050.00217.80
8.1.90.0040.00417.63
8.1.80.0000.00817.59
8.1.70.0050.00217.62
8.1.60.0030.00617.84
8.1.50.0060.00317.76
8.1.40.0040.00417.76
8.1.30.0000.00817.74
8.1.20.0090.00017.85
8.1.10.0040.00417.80
8.1.00.0040.00417.79
8.0.300.0000.00718.77
8.0.290.0090.00017.40
8.0.280.0030.00518.59
8.0.270.0040.00417.43
8.0.260.0050.00217.17
8.0.250.0040.00417.27
8.0.240.0000.00717.30
8.0.230.0070.00017.20
8.0.220.0070.00017.08
8.0.210.0050.00217.12
8.0.200.0000.00617.29
8.0.190.0000.00817.34
8.0.180.0050.00517.26
8.0.170.0030.00617.20
8.0.160.0050.00317.27
8.0.150.0000.00717.05
8.0.140.0000.00717.26
8.0.130.0060.00013.58
8.0.120.0080.00017.23
8.0.110.0040.00417.23
8.0.100.0040.00417.27
8.0.90.0000.00717.32
8.0.80.0030.01317.20
8.0.70.0050.00317.02
8.0.60.0040.00417.14
8.0.50.0040.00417.11
8.0.30.0110.00817.37
8.0.20.0160.00417.49
8.0.10.0000.00817.39
8.0.00.0110.00917.07
7.4.330.0000.00515.21
7.4.320.0050.00216.66
7.4.300.0070.00016.71
7.4.290.0030.00516.73
7.4.280.0050.00216.67
7.4.270.0000.00716.81
7.4.260.0040.00416.60
7.4.250.0060.00316.77
7.4.240.0080.00016.68
7.4.230.0000.00716.80
7.4.220.0160.01516.62
7.4.210.0120.00616.83
7.4.200.0040.00416.82
7.4.190.0040.00416.98
7.4.160.0060.01016.70
7.4.150.0190.00317.40
7.4.140.0130.00617.86
7.4.130.0050.01916.81
7.4.120.0140.00716.78
7.4.110.0120.00616.77
7.4.100.0120.00916.79
7.4.90.0060.01316.83
7.4.80.0030.01319.39
7.4.70.0060.01716.78
7.4.60.0100.00716.88
7.4.50.0000.00816.91
7.4.40.0030.01422.77
7.4.30.0120.00616.55
7.4.00.0030.01415.39
7.3.330.0060.00013.61
7.3.320.0000.00613.36
7.3.310.0050.00216.60
7.3.300.0070.00016.46
7.3.290.0040.01116.73
7.3.280.0120.01116.59
7.3.270.0130.00417.40
7.3.260.0100.00716.69
7.3.250.0080.01216.66
7.3.240.0150.00416.82
7.3.230.0090.01516.87
7.3.210.0030.01416.74
7.3.200.0040.01216.80
7.3.190.0090.01016.58
7.3.180.0090.00616.84
7.3.170.0030.01316.70
7.3.160.0060.01316.50
7.3.120.0070.01015.07
7.3.10.0090.00916.70
7.3.00.0110.01016.45
7.2.330.0060.01217.12
7.2.320.0100.00716.78
7.2.310.0230.00017.09
7.2.300.0060.01216.91
7.2.290.0110.00716.69
7.2.130.0110.00916.85
7.2.120.0080.01316.87
7.2.110.0100.00916.98
7.2.100.0070.01016.72
7.2.90.0130.01116.86
7.2.80.0050.01417.14
7.2.70.0130.00817.14
7.2.60.0070.00916.98
7.2.50.0110.00716.97
7.2.40.0110.00916.88
7.2.30.0090.00916.91
7.2.20.0110.00716.90
7.2.10.0110.00916.83
7.2.00.0070.00917.96
7.1.250.0110.00816.07
7.1.200.0090.00616.01
7.1.100.0030.00918.24
7.1.70.0000.00817.55
7.1.60.0030.01719.32
7.1.50.0130.01017.28
7.1.00.0000.08022.29
7.0.200.0030.00616.99
7.0.140.0030.07322.12
7.0.100.0100.08020.00
7.0.90.0130.07319.92
7.0.80.0170.05719.98
7.0.70.0100.07019.98
7.0.60.0130.08319.87
7.0.50.0100.05320.34
7.0.40.0070.06019.99
7.0.30.0070.06720.05
7.0.20.0100.08320.00
7.0.10.0100.08020.04
7.0.00.0170.09020.03
5.6.280.0030.07720.79
5.6.250.0070.05320.60
5.6.240.0100.08020.66
5.6.230.0130.08020.59
5.6.220.0100.08320.63
5.6.210.0070.04320.57
5.6.200.0000.07321.04
5.6.190.0200.07321.11
5.6.180.0130.08021.14
5.6.170.0030.04721.01
5.6.160.0070.05321.04
5.6.150.0000.08720.90
5.6.140.0030.07321.04
5.6.130.0130.06020.91
5.6.120.0000.04720.89
5.6.110.0100.03721.06
5.6.100.0030.04321.03
5.6.90.0030.04321.03
5.6.80.0070.03720.26
5.6.70.0000.08320.30
5.6.60.0200.06720.39
5.6.50.0100.03720.39
5.6.40.0000.05720.40
5.6.30.0170.05020.50
5.6.20.0070.03720.35
5.6.10.0070.03720.35
5.6.00.0070.05720.31
5.5.380.0230.06020.53
5.5.370.0030.04720.34
5.5.360.0130.07320.38
5.5.350.0130.04720.39
5.5.340.0070.04320.84
5.5.330.0070.07720.61
5.5.320.0100.08320.80
5.5.310.0130.08020.88
5.5.300.0030.06020.85
5.5.290.0100.04020.84
5.5.280.0100.04320.74
5.5.270.0100.04020.76
5.5.260.0170.03020.83
5.5.250.0000.04720.54
5.5.240.0030.04020.21
5.5.230.0030.04320.23
5.5.220.0000.04320.12
5.5.210.0030.04020.10
5.5.200.0070.08020.21
5.5.190.0000.04320.25
5.5.180.0030.05020.23
5.5.160.0070.05020.05
5.5.150.0100.03320.21
5.5.140.0030.03319.95
5.5.130.0000.03720.09
5.5.120.0070.04020.07
5.5.110.0070.05720.19
5.5.100.0100.03320.13
5.5.90.0070.03320.03
5.5.80.0000.04020.01
5.5.70.0100.03320.12
5.5.60.0070.03020.05
5.5.50.0100.03320.02
5.5.40.0030.03720.11
5.5.30.0030.05719.96
5.5.20.0070.03720.02
5.5.10.0070.08019.93
5.5.00.0000.04319.95
5.4.450.0000.04319.40
5.4.440.0100.05719.44
5.4.430.0030.04019.45
5.4.420.0100.03719.44
5.4.410.0070.04719.29
5.4.400.0000.04319.23
5.4.390.0070.06719.03
5.4.380.0100.05719.04
5.4.370.0100.04019.20
5.4.360.0030.07319.21
5.4.350.0100.03019.22
5.4.340.0070.03719.12
5.4.320.0000.04019.09
5.4.310.0070.03018.84
5.4.300.0030.04018.91
5.4.290.0030.06319.18
5.4.280.0100.02718.84
5.4.270.0030.03318.95
5.4.260.0000.04019.03
5.4.250.0030.04019.03
5.4.240.0070.03319.04
5.4.230.0070.03319.11
5.4.220.0030.03319.12
5.4.210.0030.03719.11
5.4.200.0030.03019.13
5.4.190.0030.03718.86
5.4.180.0030.03019.08
5.4.170.0000.04319.02
5.4.160.0070.03719.01
5.4.150.0030.03719.16
5.4.140.0100.03016.30
5.4.130.0100.05316.36
5.4.120.0070.03316.33
5.4.110.0000.04016.43
5.4.100.0070.04316.33
5.4.90.0070.02716.50
5.4.80.0130.07016.37
5.4.70.0100.04016.27
5.4.60.0070.03716.41
5.4.50.0100.07016.36
5.4.40.0070.03716.48
5.4.30.0070.03716.40
5.4.20.0030.06716.36
5.4.10.0030.06316.25
5.4.00.0100.07715.80
5.3.290.0000.04014.76
5.3.280.0000.04014.59
5.3.270.0000.04014.60
5.3.260.0000.04314.71
5.3.250.0100.03014.57
5.3.240.0000.04014.61
5.3.230.0030.03714.54
5.3.220.0030.04314.69
5.3.210.0000.04014.70
5.3.200.0030.05014.65
5.3.190.0000.04714.69
5.3.180.0030.07714.57
5.3.170.0030.05014.53
5.3.160.0070.07014.69
5.3.150.0030.08014.59
5.3.140.0030.06014.66
5.3.130.0000.05314.62
5.3.120.0070.03714.65
5.3.110.0130.07314.61
5.3.100.0100.06713.99
5.3.90.0100.05314.10
5.3.80.0070.05014.10
5.3.70.0070.05314.03
5.3.60.0100.07313.93
5.3.50.0030.07713.87
5.3.40.0200.06713.96
5.3.30.0130.06313.86
5.3.20.0070.03313.61
5.3.10.0130.06713.65
5.3.00.0000.04313.75
5.2.170.0100.06011.20
5.2.160.0070.06311.27
5.2.150.0100.05711.11
5.2.140.0030.03011.05
5.2.130.0100.05711.13
5.2.120.0000.03710.99
5.2.110.0000.07011.11
5.2.100.0030.06710.95
5.2.90.0130.03711.18
5.2.80.0030.03711.29
5.2.70.0000.03311.14
5.2.60.0070.06310.95
5.2.50.0070.05711.11
5.2.40.0030.06310.90
5.2.30.0000.06710.92
5.2.20.0170.05011.01
5.2.10.0070.06010.95
5.2.00.0000.04310.77
5.1.60.0130.04010.41
5.1.50.0000.03710.41
5.1.40.0030.05310.41
5.1.30.0070.05010.41
5.1.20.0030.05310.49
5.1.10.0070.03710.41
5.1.00.0000.03310.41
5.0.50.0030.04710.41
5.0.40.0100.04010.41
5.0.30.0030.06710.41
5.0.20.0000.03310.41
5.0.10.0030.05010.41
5.0.00.0000.07310.41
4.4.90.0000.03710.41
4.4.80.0030.03310.41
4.4.70.0000.03710.41
4.4.60.0070.02310.41
4.4.50.0030.03710.41
4.4.40.0070.04310.41
4.4.30.0000.03710.41
4.4.20.0000.03010.41
4.4.10.0030.01310.41
4.4.00.0000.06010.41
4.3.110.0070.03010.41
4.3.100.0070.02710.41
4.3.90.0030.04010.41
4.3.80.0000.05310.41
4.3.70.0070.02710.41
4.3.60.0000.03010.41
4.3.50.0070.03310.41
4.3.40.0000.05710.41
4.3.30.0000.03310.41
4.3.20.0070.03310.41
4.3.10.0030.02310.41
4.3.00.0070.03010.41

preferences:
41.36 ms | 401 KiB | 5 Q