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.0140.00718.97
8.3.30.0040.01118.92
8.3.20.0080.00020.16
8.3.10.0080.00023.53
8.3.00.0040.00419.63
8.2.170.0150.00022.96
8.2.160.0070.01020.55
8.2.150.0030.00724.18
8.2.140.0080.00024.66
8.2.130.0030.00526.16
8.2.120.0000.00822.32
8.2.110.0100.00022.14
8.2.100.0060.00618.04
8.2.90.0000.00818.28
8.2.80.0050.00318.00
8.2.70.0030.00617.88
8.2.60.0000.00918.05
8.2.50.0040.00418.07
8.2.40.0050.00320.10
8.2.30.0040.00418.41
8.2.20.0080.00018.07
8.2.10.0030.00518.30
8.2.00.0000.00918.04
8.1.270.0050.00324.00
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00022.59
8.1.230.0070.00420.92
8.1.220.0040.00417.91
8.1.210.0030.00618.77
8.1.200.0000.00917.60
8.1.190.0030.00617.48
8.1.180.0090.00018.10
8.1.170.0000.00818.69
8.1.160.0040.00422.04
8.1.150.0080.00018.92
8.1.140.0090.00017.74
8.1.130.0030.00317.93
8.1.120.0080.00017.68
8.1.110.0000.00717.65
8.1.100.0030.00517.73
8.1.90.0050.00317.73
8.1.80.0000.00717.76
8.1.70.0000.00717.66
8.1.60.0060.00317.76
8.1.50.0040.00417.80
8.1.40.0050.00317.63
8.1.30.0040.00417.89
8.1.20.0080.00017.70
8.1.10.0030.00517.69
8.1.00.0000.00717.65
8.0.300.0040.00420.04
8.0.290.0000.00717.18
8.0.280.0040.00418.64
8.0.270.0030.00317.21
8.0.260.0030.00317.35
8.0.250.0000.00717.31
8.0.240.0060.00317.32
8.0.230.0030.00317.19
8.0.220.0080.00017.29
8.0.210.0000.00717.24
8.0.200.0000.00717.26
8.0.190.0070.00017.21
8.0.180.0060.00617.21
8.0.170.0050.00317.18
8.0.160.0070.00017.34
8.0.150.0000.00717.23
8.0.140.0040.00417.18
8.0.130.0060.00013.66
8.0.120.0000.00817.23
8.0.110.0000.00717.29
8.0.100.0080.00017.22
8.0.90.0040.00417.23
8.0.80.0100.00717.23
8.0.70.0050.00317.35
8.0.60.0000.00717.13
8.0.50.0040.00417.11
8.0.30.0160.00717.25
8.0.20.0120.00717.52
8.0.10.0050.00317.34
8.0.00.0120.00616.91
7.4.330.0050.00015.00
7.4.320.0030.00316.63
7.4.300.0030.00316.74
7.4.290.0040.00416.84
7.4.280.0040.00416.77
7.4.270.0040.00416.85
7.4.260.0070.00016.67
7.4.250.0080.00016.59
7.4.240.0040.00516.76
7.4.230.0050.00316.76
7.4.220.0190.00916.68
7.4.210.0050.01016.78
7.4.200.0040.00416.83
7.4.190.0000.00716.59
7.4.160.0080.01016.72
7.4.150.0120.00617.40
7.4.140.0160.00417.86
7.4.130.0130.00516.73
7.4.120.0100.01016.80
7.4.110.0100.01716.63
7.4.100.0130.00717.02
7.4.90.0110.00816.77
7.4.80.0190.00819.39
7.4.70.0080.00816.73
7.4.60.0060.01816.79
7.4.50.0050.00516.79
7.4.40.0090.00916.86
7.4.30.0030.01416.94
7.4.10.0070.01115.21
7.4.00.0070.00915.11
7.3.330.0000.00813.51
7.3.320.0000.00613.58
7.3.310.0000.00716.62
7.3.300.0080.00016.49
7.3.290.0110.00316.65
7.3.280.0090.00916.66
7.3.270.0070.01417.40
7.3.260.0030.01616.85
7.3.250.0040.01516.80
7.3.240.0060.01316.63
7.3.230.0080.01216.71
7.3.210.0210.01516.77
7.3.200.0030.02119.39
7.3.190.0030.01816.89
7.3.180.0110.00616.74
7.3.170.0090.00916.75
7.3.160.0070.01116.65
7.3.130.0030.01415.18
7.3.120.0070.01115.16
7.3.110.0080.01015.12
7.3.100.0080.01015.16
7.3.90.0050.01015.05
7.3.80.0100.00515.03
7.3.70.0070.00815.13
7.3.60.0100.00215.07
7.3.50.0070.00815.07
7.3.40.0050.01015.06
7.3.30.0090.00615.21
7.3.20.0100.00716.96
7.3.10.0080.00616.92
7.3.00.0050.00916.94
7.2.330.0140.00516.93
7.2.320.0090.01216.86
7.2.310.0180.00616.86
7.2.300.0070.01717.02
7.2.290.0100.01017.07
7.2.260.0070.01515.57
7.2.250.0090.01015.33
7.2.240.0050.01015.42
7.2.230.0080.00915.25
7.2.220.0080.00915.15
7.2.210.0060.01115.27
7.2.200.0040.01115.39
7.2.190.0080.00815.33
7.2.180.0030.01215.06
7.2.170.0030.01115.19
7.2.160.0030.01215.05
7.2.150.0090.00616.98
7.2.140.0100.00717.26
7.2.130.0000.01716.86
7.2.120.0000.01017.04
7.2.110.0090.00917.18
7.2.100.0100.00717.16
7.2.90.0000.01217.29
7.2.80.0070.00316.84
7.2.70.0040.01117.31
7.2.60.0080.00917.03
7.2.50.0100.00717.10
7.2.40.0070.00716.91
7.2.30.0070.00717.34
7.2.20.0120.00017.18
7.2.10.0110.00617.00
7.2.00.0030.01018.32
7.1.330.0070.00815.97
7.1.320.0100.00716.01
7.1.310.0030.01415.96
7.1.300.0070.00715.83
7.1.290.0040.00815.97
7.1.280.0050.01015.92
7.1.270.0070.00616.03
7.1.260.0060.00815.81
7.1.250.0070.00716.07
7.1.240.0000.01115.99
7.1.230.0060.01015.82
7.1.220.0090.00316.02
7.1.210.0040.00815.95
7.1.200.0040.00916.07
7.1.190.0070.00716.25
7.1.180.0070.01115.91
7.1.170.0090.00015.88
7.1.160.0070.00716.07
7.1.150.0070.00715.90
7.1.140.0060.00616.13
7.1.130.0060.00616.11
7.1.120.0060.00316.23
7.1.110.0040.01116.18
7.1.100.0100.00517.21
7.1.90.0140.00016.04
7.1.80.0040.00815.92
7.1.70.0000.01416.66
7.1.60.0090.01317.81
7.1.50.0110.00816.49
7.1.40.0090.00616.02
7.1.30.0040.01115.95
7.1.20.0030.01015.76
7.1.10.0070.00716.12
7.1.00.0060.04119.21
7.0.330.0030.00915.62
7.0.320.0070.00715.70
7.0.310.0040.00715.59
7.0.300.0030.00915.57
7.0.290.0040.01115.61
7.0.280.0000.01015.56
7.0.270.0040.00415.50
7.0.260.0070.01015.72
7.0.250.0040.01115.75
7.0.240.0070.00715.49
7.0.230.0030.01015.66
7.0.220.0000.01415.74
7.0.210.0040.00715.45
7.0.200.0050.00916.31
7.0.190.0050.00515.57
7.0.180.0060.00915.43
7.0.170.0040.00715.64
7.0.160.0030.00915.33
7.0.150.0030.00915.56
7.0.140.0030.04318.81
7.0.130.0040.01115.55
7.0.120.0090.00615.57
7.0.110.0140.00015.61
7.0.100.0040.02618.81
7.0.90.0050.02318.74
7.0.80.0010.03118.64
7.0.70.0030.02718.75
7.0.60.0000.02918.82
7.0.50.0000.04718.89
7.0.40.0070.02716.82
7.0.30.0070.02016.91
7.0.20.0060.02316.76
7.0.10.0050.02516.93
7.0.00.0020.02716.84
5.6.400.0000.01114.58
5.6.390.0040.00814.73
5.6.380.0030.00914.81
5.6.370.0000.01014.70
5.6.360.0060.00314.39
5.6.350.0000.01414.91
5.6.340.0040.01114.70
5.6.330.0030.01214.70
5.6.320.0090.00614.91
5.6.310.0030.00914.79
5.6.300.0130.00314.57
5.6.290.0040.01114.78
5.6.280.0070.04217.81
5.6.270.0120.00614.79
5.6.260.0060.00914.35
5.6.250.0090.02417.56
5.6.240.0060.02517.66
5.6.230.0030.02417.59
5.6.220.0030.02317.71
5.6.210.0020.02317.51
5.6.200.0050.02717.85
5.6.190.0060.03217.68
5.6.180.0060.02117.87
5.6.170.0060.02517.85
5.6.160.0040.02717.91
5.6.150.0070.02218.00
5.6.140.0030.03217.73
5.6.130.0070.02717.67
5.6.120.0090.01917.89
5.6.110.0030.02717.77
5.6.100.0050.02317.80
5.6.90.0060.04017.78
5.6.80.0050.02017.54
5.6.70.0050.02217.43
5.6.60.0030.04317.24
5.6.50.0050.03917.33
5.6.40.0050.04217.44
5.6.30.0040.03117.43
5.6.20.0100.03617.45
5.6.10.0040.04417.38
5.6.00.0030.03617.37
5.5.380.0040.02317.48
5.5.370.0070.02017.41
5.5.360.0020.02817.30
5.5.350.0100.04117.40
5.5.340.0030.03117.91
5.5.330.0030.02317.63
5.5.320.0040.02817.81
5.5.310.0020.02817.58
5.5.300.0060.04617.68
5.5.290.0060.02517.62
5.5.280.0050.02417.76
5.5.270.0020.02517.83
5.5.260.0050.02617.49
5.5.250.0050.02517.34
5.5.240.0020.02617.42
5.5.230.0050.02317.31
5.5.220.0000.03217.23
5.5.210.0100.04017.34
5.5.200.0070.04217.22
5.5.190.0030.04617.27
5.5.180.0030.04217.35
5.5.170.0000.01414.57
5.5.160.0060.04317.25
5.5.150.0080.02517.25
5.5.140.0080.04417.22
5.5.130.0050.04417.11
5.5.120.0080.03817.21
5.5.110.0050.04917.14
5.5.100.0070.02517.34
5.5.90.0080.03817.42
5.5.80.0030.03717.34
5.5.70.0100.02917.48
5.5.60.0080.04117.32
5.5.50.0070.02817.25
5.5.40.0040.03217.24
5.5.30.0030.04017.31
5.5.20.0060.04317.18
5.5.10.0080.03317.15
5.5.00.0050.04717.24
5.4.450.0080.01815.41
5.4.440.0040.02415.41
5.4.430.0020.02415.34
5.4.420.0090.02615.44
5.4.410.0050.02615.24
5.4.400.0050.02815.18
5.4.390.0030.02315.11
5.4.380.0050.03815.13
5.4.370.0050.02515.23
5.4.360.0040.03915.24
5.4.350.0000.03115.03
5.4.340.0020.03414.98
5.4.330.0030.00911.44
5.4.320.0030.02715.22
5.4.310.0080.04115.25
5.4.300.0060.04315.12
5.4.290.0000.03915.21
5.4.280.0020.03115.14
5.4.270.0050.04315.03
5.4.260.0080.02215.06
5.4.250.0020.02815.19
5.4.240.0030.04115.09
5.4.230.0060.02115.26
5.4.220.0050.03115.03
5.4.210.0020.04015.13
5.4.200.0050.02515.33
5.4.190.0080.03615.10
5.4.180.0020.03615.16
5.4.170.0060.03215.17
5.4.160.0070.04015.26
5.4.150.0050.03415.28
5.4.140.0050.04213.96
5.4.130.0050.03813.85
5.4.120.0050.02913.87
5.4.110.0030.03913.91
5.4.100.0030.02613.74
5.4.90.0030.04013.86
5.4.80.0050.04013.84
5.4.70.0030.04313.72
5.4.60.0080.02313.91
5.4.50.0060.02013.78
5.4.40.0050.03913.87
5.4.30.0030.03813.94
5.4.20.0020.02813.67
5.4.10.0050.04013.66
5.4.00.0030.03813.59
5.3.290.0030.04312.94
5.3.280.0030.04412.79
5.3.270.0060.03012.72
5.3.260.0030.04012.80
5.3.250.0050.03912.62
5.3.240.0030.03012.62
5.3.230.0080.03812.80
5.3.220.0060.02212.64
5.3.210.0000.03512.66
5.3.200.0060.04312.53
5.3.190.0090.04112.66
5.3.180.0050.03312.71
5.3.170.0020.04012.70
5.3.160.0020.04512.73
5.3.150.0020.04112.74
5.3.140.0050.03512.70
5.3.130.0050.04012.74
5.3.120.0050.04312.55
5.3.110.0020.04612.61
5.3.100.0070.04012.41
5.3.90.0070.02212.51
5.3.80.0050.03812.40
5.3.70.0010.04212.40
5.3.60.0080.04012.26
5.3.50.0010.04012.25
5.3.40.0030.03012.45
5.3.30.0040.02412.43
5.3.20.0050.03912.08
5.3.10.0030.03912.01
5.3.00.0030.03712.17

preferences:
34.86 ms | 400 KiB | 5 Q