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; }*/ // NEW NEW NEW NEW ======================= $thisMondayInt = intval(date('Ymd', strtotime('- ' . (intval(date('N')) - 1) . ' days'))); $dateInt = intval(date("Ymd", mktime(0, 0, 0, $month, $day, $year))); if ($thisMondayInt > $dateInt) { continue; } // NEW NEW NEW NEW ======================= // A hónap végén azokat a heteket nem jelenítjük meg, amikre még nem lehetne jelentkezni. $utolsoJelentkezhetoNap = strtotime("+ 28 day"); $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; }*/ // NEW NEW NEW NEW ======================= $SundayOfFourWeeksLaterInt = intval(date('Ymd', strtotime('+ ' . (28 + 7 - intval(date('N', strtotime('+ 28 days')))) . ' days'))); if ($dateInt > $SundayOfFourWeeksLaterInt) { $kellenekUresNapokAHonapVegen = false; continue; } // NEW NEW NEW NEW ======================= 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; // .... 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()); 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.0070.01316.75
8.3.50.0090.01122.11
8.3.40.0040.01218.95
8.3.30.0130.00319.04
8.3.20.0040.00420.21
8.3.10.0060.00323.48
8.3.00.0070.00717.60
8.2.180.0100.00716.75
8.2.170.0120.01222.96
8.2.160.0130.01020.34
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0100.01026.16
8.2.120.0100.01022.17
8.2.110.0130.01022.32
8.2.100.0130.00018.22
8.2.90.0000.00918.34
8.2.80.0060.00318.18
8.2.70.0030.00717.88
8.2.60.0090.00018.00
8.2.50.0090.00018.05
8.2.40.0000.01018.41
8.2.30.0090.00018.30
8.2.20.0030.00618.17
8.2.10.0030.00618.07
8.2.00.0040.00418.15
8.1.280.0120.00925.92
8.1.270.0050.00522.20
8.1.260.0030.00626.35
8.1.250.0080.00028.09
8.1.240.0060.01623.97
8.1.230.0030.01020.94
8.1.220.0070.00317.91
8.1.210.0030.00618.96
8.1.200.0070.00317.53
8.1.190.0070.00317.48
8.1.180.0100.00018.10
8.1.170.0000.00919.38
8.1.160.0060.00322.27
8.1.150.0030.00618.97
8.1.140.0040.00417.77
8.1.130.0080.00018.05
8.1.120.0000.00917.63
8.1.110.0000.00917.79
8.1.100.0030.00617.66
8.1.90.0060.00317.66
8.1.80.0030.00617.64
8.1.70.0050.00317.66
8.1.60.0030.00717.84
8.1.50.0060.00317.76
8.1.40.0000.01017.71
8.1.30.0000.01017.77
8.1.20.0100.00017.75
8.1.10.0040.00417.85
8.1.00.0060.00317.79
8.0.300.0040.00422.04
8.0.290.0000.00917.00
8.0.280.0060.00318.61
8.0.270.0080.00017.42
8.0.260.0080.00317.17
8.0.250.0000.00817.33
8.0.240.0050.00317.30
8.0.230.0030.00717.19
8.0.220.0050.00517.29
8.0.210.0030.00517.25
8.0.200.0040.00417.28
8.0.190.0040.00417.20
8.0.180.0090.00017.14
8.0.170.0030.00717.24
8.0.160.0060.00317.08
8.0.150.0060.00317.20
8.0.140.0000.00817.26
8.0.130.0030.00313.64
8.0.120.0040.00417.23
8.0.110.0060.00317.17
8.0.100.0030.00717.08
8.0.90.0000.00817.24
8.0.80.0150.00617.21
8.0.70.0100.00017.13
8.0.60.0060.00317.23
8.0.50.0000.00817.13
8.0.30.0130.00817.31
8.0.20.0090.01317.40
8.0.10.0040.00417.34
8.0.00.0130.01116.96
7.4.330.0030.00315.21
7.4.320.0040.00416.84
7.4.300.0080.00016.80
7.4.290.0060.00316.85
7.4.280.0030.00616.76
7.4.270.0000.00816.70
7.4.260.0030.00616.73
7.4.250.0060.00316.68
7.4.240.0030.00516.73
7.4.230.0040.00416.90
7.4.220.0070.01516.76
7.4.210.0040.01216.76
7.4.200.0000.00816.74
7.4.190.0040.00416.98
7.4.160.0120.00616.63
7.4.150.0140.00717.40
7.4.140.0170.01017.86
7.4.130.0080.01116.68
7.4.120.0050.01316.84
7.4.110.0160.00416.60
7.4.100.0060.01516.92
7.4.90.0030.01816.83
7.4.80.0090.00919.39
7.4.70.0090.00916.88
7.4.60.0100.00716.69
7.4.50.0030.00316.85
7.4.40.0040.01422.77
7.4.30.0040.01516.64
7.4.00.0110.00415.23
7.3.330.0060.00013.51
7.3.320.0080.00013.39
7.3.310.0080.00016.61
7.3.300.0030.00516.61
7.3.290.0100.00716.58
7.3.280.0100.01416.58
7.3.270.0120.00617.40
7.3.260.0100.01016.69
7.3.250.0120.00816.66
7.3.240.0060.01416.68
7.3.230.0060.01616.74
7.3.210.0100.01016.76
7.3.200.0100.01119.39
7.3.190.0120.01516.67
7.3.180.0070.01116.70
7.3.170.0080.01116.76
7.3.160.0100.01016.74
7.3.120.0070.01015.29
7.3.10.0070.01016.55
7.3.00.0110.00516.86
7.2.330.0140.00716.73
7.2.320.0140.01116.63
7.2.310.0120.01517.10
7.2.300.0150.01216.98
7.2.290.0120.00817.13
7.2.130.0080.01317.19
7.2.120.0060.01017.09
7.2.110.0120.00816.94
7.2.100.0020.01517.22
7.2.90.0140.00517.04
7.2.80.0120.00917.03
7.2.70.0090.01217.05
7.2.60.0080.01016.94
7.2.50.0040.01617.09
7.2.40.0110.00917.04
7.2.30.0100.01317.12
7.2.20.0100.00916.98
7.2.10.0130.01017.00
7.2.00.0080.00918.08
7.1.250.0090.00616.00
7.1.200.0090.00316.14
7.1.100.0000.01318.43
7.1.70.0000.00817.28
7.1.60.0100.01719.31
7.1.50.0070.01834.74
7.1.00.0000.09022.31
7.0.200.0090.00616.88
7.0.140.0070.07322.01
7.0.90.0170.07720.18
7.0.80.0170.04719.94
7.0.70.0400.04319.97
7.0.60.0070.03720.11
7.0.50.0030.08320.39
7.0.40.0030.04720.04
7.0.30.0070.04020.05
7.0.20.0100.06320.04
7.0.10.0000.09020.04
7.0.00.0100.08320.18
5.6.280.0070.07020.91
5.6.240.0130.04020.71
5.6.230.0070.07020.70
5.6.220.0100.06020.64
5.6.210.0100.07320.75
5.6.200.0100.06721.16
5.6.190.0070.04021.16
5.6.180.0030.07321.14
5.6.170.0130.07720.96
5.6.160.0000.04721.12
5.6.150.0070.04021.03
5.6.140.0000.06021.09
5.6.130.0070.07320.95
5.6.120.0070.04021.13
5.6.110.0130.07721.14
5.6.100.0030.07321.12
5.6.90.0100.08021.07
5.6.80.0000.09320.35
5.6.70.0100.03020.46
5.6.60.0070.05720.43
5.6.50.0200.07020.48
5.6.40.0030.07020.39
5.6.30.0100.03720.40
5.6.20.0170.07320.54
5.6.10.0130.07320.32
5.6.00.0100.05320.44
5.5.380.0100.04720.47
5.5.370.0030.08020.44
5.5.360.0070.04720.41
5.5.350.0070.08020.41
5.5.340.0170.07020.88
5.5.330.0070.08320.88
5.5.320.0070.04720.77
5.5.310.0000.05320.94
5.5.300.0100.03720.90
5.5.290.0070.08020.92
5.5.280.0130.04320.66
5.5.270.0070.08020.76
5.5.260.0100.08320.93
5.5.250.0070.07320.73
5.5.240.0000.04020.18
5.5.230.0100.07720.16
5.5.220.0000.08020.13
5.5.210.0000.04720.28
5.5.200.0100.07320.17
5.5.190.0070.03720.24
5.5.180.0070.06720.23
5.5.160.0000.08720.30
5.5.150.0070.04320.27
5.5.140.0070.04320.19
5.5.130.0100.04020.15
5.5.120.0130.07320.29
5.5.110.0070.04720.25
5.5.100.0130.06320.12
5.5.90.0100.07720.18
5.5.80.0030.04720.09
5.5.70.0100.06720.17
5.5.60.0070.07020.16
5.5.50.0030.05720.16
5.5.40.0000.06320.10
5.5.30.0130.07720.05
5.5.20.0070.08020.10
5.5.10.0070.04020.09
5.5.00.0070.07720.09
5.4.450.0070.06319.17
5.4.440.0100.07019.26
5.4.430.0070.06019.45
5.4.420.0000.06319.55
5.4.410.0030.04719.21
5.4.400.0070.06718.88
5.4.390.0070.06719.05
5.4.380.0070.07318.87
5.4.370.0070.03718.85
5.4.360.0100.07319.12
5.4.350.0030.06718.93
5.4.340.0070.03718.90
5.4.320.0030.08019.05
5.4.310.0030.05719.19
5.4.300.0070.09019.04
5.4.290.0100.04718.88
5.4.280.0000.08719.03
5.4.270.0100.03318.95
5.4.260.0030.08319.12
5.4.250.0070.04318.84
5.4.240.0100.04718.87
5.4.230.0070.04019.03
5.4.220.0030.04719.04
5.4.210.0130.06019.03
5.4.200.0130.06719.04
5.4.190.0100.07019.02
5.4.180.0030.04319.15
5.4.170.0030.07718.93
5.4.160.0070.08319.14
5.4.150.0100.04718.88
5.4.140.0000.08016.46
5.4.130.0000.08316.46
5.4.120.0030.08016.38
5.4.110.0070.04316.43
5.4.100.0000.07716.38
5.4.90.0070.05016.32
5.4.80.0130.06316.61
5.4.70.0030.04316.34
5.4.60.0070.05716.42
5.4.50.0030.07016.46
5.4.40.0070.04016.32
5.4.30.0100.06716.45
5.4.20.0070.03316.41
5.4.10.0030.05016.30
5.4.00.0100.06015.89
5.3.290.0070.08014.75
5.3.280.0100.06714.62
5.3.270.0100.04314.59
5.3.260.0230.04014.77
5.3.250.0030.06714.62
5.3.240.0070.07014.75
5.3.230.0100.04714.76
5.3.220.0100.06314.73
5.3.210.0100.07714.62
5.3.200.0100.07014.68
5.3.190.0170.06714.68
5.3.180.0030.06014.64
5.3.170.0130.06314.66
5.3.160.0130.06314.62
5.3.150.0030.08014.64
5.3.140.0130.07314.69
5.3.130.0070.03714.71
5.3.120.0100.05014.50
5.3.110.0030.08014.59
5.3.100.0000.04014.17
5.3.90.0070.07314.03
5.3.80.0100.07014.09
5.3.70.0170.05314.11
5.3.60.0070.07014.09
5.3.50.0000.05014.04
5.3.40.0070.05314.08
5.3.30.0070.08013.95
5.3.20.0030.06013.75
5.3.10.0070.05713.71
5.3.00.0100.06013.78
5.2.170.0030.04711.07
5.2.160.0030.06311.18
5.2.150.0030.07011.09
5.2.140.0070.06011.06
5.2.130.0070.03711.22
5.2.120.0000.03711.04
5.2.110.0100.06311.02
5.2.100.0070.02711.25
5.2.90.0070.05711.19
5.2.80.0100.05011.58
5.2.70.0030.06711.43
5.2.60.0000.03311.14
5.2.50.0100.05711.11
5.2.40.0070.03710.92
5.2.30.0030.02710.91
5.2.20.0100.06011.04
5.2.10.0070.05010.87
5.2.00.0070.05710.86
5.1.60.0030.06010.25
5.1.50.0030.03310.25
5.1.40.0030.03010.25
5.1.30.0030.05310.38
5.1.20.0000.04010.25
5.1.10.0030.05310.25
5.1.00.0030.03010.25
5.0.50.0030.04010.25
5.0.40.0030.02710.25
5.0.30.0100.06010.25
5.0.20.0100.04010.25
5.0.10.0130.04010.25
5.0.00.0070.04710.25
4.4.90.0000.02010.25
4.4.80.0030.03010.25
4.4.70.0000.01710.25
4.4.60.0000.03710.25
4.4.50.0000.01710.25
4.4.40.0070.04710.25
4.4.30.0070.01310.25
4.4.20.0070.01310.25
4.4.10.0030.01710.25
4.4.00.0100.05310.25
4.3.110.0130.03010.25
4.3.100.0100.03310.25
4.3.90.0000.03010.25
4.3.80.0030.02710.25
4.3.70.0000.04010.25
4.3.60.0030.03010.25
4.3.50.0030.02010.25
4.3.40.0070.02310.25
4.3.30.0030.02010.25
4.3.20.0030.03010.25
4.3.10.0000.02310.25
4.3.00.0000.03310.25

preferences:
48.45 ms | 401 KiB | 5 Q