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(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.0040.01819.14
8.3.30.0110.01118.96
8.3.20.0190.00019.07
8.3.10.0130.00720.46
8.3.00.0060.00319.63
8.2.170.0080.00822.96
8.2.160.0070.00722.29
8.2.150.0030.00624.18
8.2.140.0200.00024.66
8.2.130.0060.01226.16
8.2.120.0150.00420.07
8.2.110.0100.00022.25
8.2.100.0090.00318.16
8.2.90.0100.00018.00
8.2.80.0030.00619.13
8.2.70.0060.00318.13
8.2.60.0080.00018.13
8.2.50.0000.00817.86
8.2.40.0100.00019.63
8.2.30.0000.00819.45
8.2.20.0030.00518.25
8.2.10.0000.00818.16
8.2.00.0040.00718.17
8.1.270.0030.00624.66
8.1.260.0160.00326.35
8.1.250.0030.00528.09
8.1.240.0090.00023.92
8.1.230.0120.00019.13
8.1.220.0060.00317.79
8.1.210.0030.00618.77
8.1.200.0090.00017.61
8.1.190.0060.00317.38
8.1.180.0030.00618.10
8.1.170.0030.00617.62
8.1.160.0000.00818.96
8.1.150.0020.00520.37
8.1.140.0000.00917.79
8.1.130.0040.00417.99
8.1.120.0000.00817.71
8.1.110.0030.00617.77
8.1.100.0000.00817.71
8.1.90.0040.00417.64
8.1.80.0030.00517.75
8.1.70.0040.00417.74
8.1.60.0080.00017.82
8.1.50.0000.00817.67
8.1.40.0000.00817.76
8.1.30.0030.00617.89
8.1.20.0030.00617.87
8.1.10.0080.00017.78
8.1.00.0030.00617.79
8.0.300.0040.00418.77
8.0.290.0060.00317.13
8.0.280.0000.00818.59
8.0.270.0040.00417.35
8.0.260.0000.00717.17
8.0.250.0040.00417.29
8.0.240.0070.00417.30
8.0.230.0040.00417.27
8.0.220.0000.00817.22
8.0.210.0040.00417.15
8.0.200.0000.00717.26
8.0.190.0000.00817.29
8.0.180.0000.00817.29
8.0.170.0030.00917.14
8.0.160.0030.00617.21
8.0.150.0030.00617.19
8.0.140.0050.00917.07
8.0.130.0000.00613.59
8.0.120.0030.00617.18
8.0.110.0040.00417.10
8.0.100.0000.00817.14
8.0.90.0030.00617.04
8.0.80.0070.01717.19
8.0.70.0040.00417.09
8.0.60.0080.00017.18
8.0.50.0090.00017.20
8.0.30.0090.01417.24
8.0.20.0160.00717.25
8.0.10.0040.00417.36
8.0.00.0030.01616.96
7.4.330.0050.00013.12
7.4.320.0000.00716.84
7.4.300.0030.00316.73
7.4.290.0000.00716.82
7.4.280.0050.00516.71
7.4.270.0040.00416.71
7.4.260.0030.00313.40
7.4.250.0030.00716.64
7.4.240.0070.00016.82
7.4.230.0000.00716.64
7.4.220.0030.01416.84
7.4.210.0040.01316.82
7.4.200.0050.00316.65
7.4.190.0050.00316.91
7.4.160.0030.01416.75
7.4.150.0040.01416.86
7.4.140.0140.00516.74
7.4.130.0140.00716.88
7.4.120.0110.00916.73
7.4.110.0140.00716.65
7.4.100.0060.01316.73
7.4.90.0140.00416.66
7.4.80.0000.01716.84
7.4.70.0110.00716.72
7.4.60.0090.00916.69
7.4.50.0050.00016.57
7.4.40.0070.01016.80
7.4.30.0090.00916.66
7.4.00.0080.01015.27
7.3.330.0040.00413.60
7.3.320.0030.00313.47
7.3.310.0030.00516.63
7.3.300.0080.00016.61
7.3.290.0030.01316.57
7.3.280.0100.01116.57
7.3.270.0120.01216.60
7.3.260.0150.00816.80
7.3.250.0150.00816.75
7.3.240.0200.00616.88
7.3.230.0120.00616.76
7.3.210.0060.01216.68
7.3.200.0110.01119.39
7.3.190.0030.02016.91
7.3.180.0060.01016.88
7.3.170.0060.01116.65
7.3.160.0120.00616.75
7.3.120.0080.00815.23
7.3.110.0070.01215.20
7.3.100.0050.01115.23
7.3.90.0050.01015.13
7.3.80.0050.01015.22
7.3.70.0070.00714.98
7.3.60.0100.00515.13
7.3.50.0050.01014.95
7.3.40.0040.00915.00
7.3.30.0050.00815.23
7.3.20.0110.00616.90
7.3.10.0080.00716.83
7.3.00.0100.00716.83
7.2.330.0110.00716.82
7.2.320.0150.00917.13
7.2.310.0160.01016.96
7.2.300.0000.01816.94
7.2.290.0030.01417.10
7.2.250.0120.00715.29
7.2.240.0050.01515.38
7.2.230.0110.00615.40
7.2.220.0070.01215.29
7.2.210.0090.00915.17
7.2.200.0080.00615.37
7.2.190.0090.00915.25
7.2.180.0050.01115.24
7.2.170.0040.01115.25
7.2.160.0070.00715.35
7.2.150.0030.01017.16
7.2.140.0120.00017.29
7.2.130.0100.00616.82
7.2.120.0040.01117.21
7.2.110.0150.00417.02
7.2.100.0030.01316.91
7.2.90.0110.00416.88
7.2.80.0030.00717.25
7.2.70.0040.00816.95
7.2.60.0040.00817.08
7.2.50.0000.01517.05
7.2.40.0000.01017.39
7.2.30.0130.00317.28
7.2.20.0060.00617.19
7.2.10.0040.01217.16
7.2.00.0060.00918.36
7.1.330.0080.00815.98
7.1.320.0060.00616.04
7.1.310.0070.00716.21
7.1.300.0060.01016.09
7.1.290.0040.01215.91
7.1.280.0050.00816.01
7.1.270.0090.00815.89
7.1.260.0040.01015.99
7.1.250.0060.00616.09
7.1.240.0060.00616.08
7.1.230.0090.00616.01
7.1.220.0000.01215.86
7.1.210.0080.00415.95
7.1.200.0030.01016.02
7.1.190.0060.00916.11
7.1.180.0100.00315.76
7.1.170.0000.00916.06
7.1.160.0030.01016.12
7.1.150.0070.00716.05
7.1.140.0130.00316.13
7.1.130.0030.01415.62
7.1.120.0090.00615.94
7.1.110.0030.00916.02
7.1.100.0070.00817.10
7.1.90.0000.01316.02
7.1.80.0030.00616.12
7.1.70.0030.01016.63
7.1.60.0110.00717.66
7.1.50.0060.00616.45
7.1.40.0030.01215.90
7.1.30.0030.01216.11
7.1.20.0030.00916.11
7.1.10.0030.01016.16
7.1.00.0080.03719.05
7.0.330.0070.00715.72
7.0.320.0030.00615.46
7.0.310.0000.01115.51
7.0.300.0070.00715.40
7.0.290.0030.01015.63
7.0.280.0080.00515.49
7.0.270.0070.00715.61
7.0.260.0030.00915.78
7.0.250.0130.00015.64
7.0.240.0040.00815.64
7.0.230.0130.00315.69
7.0.220.0100.00715.71
7.0.210.0070.00415.51
7.0.200.0030.00816.33
7.0.190.0070.01115.64
7.0.180.0000.01715.59
7.0.170.0040.00815.67
7.0.160.0080.00815.69
7.0.150.0110.00315.73
7.0.140.0090.03818.78
7.0.130.0040.00715.54
7.0.120.0020.04418.78
7.0.110.0030.01015.64
7.0.100.0060.00615.66
7.0.90.0020.04818.66
7.0.80.0020.05118.79
7.0.70.0070.04518.68
7.0.60.0080.04318.52
7.0.50.0060.03718.94
7.0.40.0080.04116.85
7.0.30.0050.04516.75
7.0.20.0100.04316.88
7.0.10.0030.04816.84
7.0.00.0020.05016.76
5.6.400.0000.01514.18
5.6.390.0090.00314.64
5.6.380.0100.00714.73
5.6.370.0060.00314.80
5.6.360.0040.01114.75
5.6.350.0000.01214.54
5.6.340.0080.00414.70
5.6.330.0030.01414.97
5.6.320.0070.00714.70
5.6.310.0090.00314.72
5.6.300.0130.00314.45
5.6.290.0040.01214.74
5.6.280.0060.04117.80
5.6.270.0030.01014.80
5.6.260.0070.00314.61
5.6.250.0060.01314.35
5.6.240.0060.03617.60
5.6.230.0050.03317.50
5.6.220.0020.03617.53
5.6.210.0030.04317.57
5.6.200.0090.04018.00
5.6.190.0050.04617.70
5.6.180.0020.05317.78
5.6.170.0030.04817.84
5.6.160.0040.05117.85
5.6.150.0000.05517.86
5.6.140.0110.03717.74
5.6.130.0030.03217.79
5.6.120.0080.04217.81
5.6.110.0070.03317.88
5.6.100.0050.04517.88
5.6.90.0100.04017.77
5.6.80.0060.04317.59
5.6.70.0070.03617.65
5.6.60.0070.04217.48
5.6.50.0080.04017.38
5.6.40.0050.04317.40
5.6.30.0070.04217.47
5.6.20.0110.03817.30
5.6.10.0030.03317.31
5.6.00.0030.04717.49
5.5.380.0060.04117.42
5.5.370.0050.04417.50
5.5.360.0080.04017.41
5.5.350.0070.02517.47
5.5.340.0040.04617.73
5.5.330.0030.04717.60
5.5.320.0080.04317.78
5.5.310.0050.04617.65
5.5.300.0000.03917.64
5.5.290.0030.04417.86
5.5.280.0100.04117.87
5.5.270.0030.04817.71
5.5.260.0070.04417.76
5.5.250.0050.04617.58
5.5.240.0100.04317.31
5.5.230.0060.04217.28
5.5.220.0050.04317.22
5.5.210.0050.04217.20
5.5.200.0070.02317.34
5.5.190.0020.03517.29
5.5.180.0090.04217.45
5.5.170.0070.01414.18
5.5.160.0050.04317.21
5.5.150.0100.03817.18
5.5.140.0090.04317.33
5.5.130.0100.04117.44
5.5.120.0070.03017.32
5.5.110.0050.04617.34
5.5.100.0080.03817.21
5.5.90.0100.02717.12
5.5.80.0080.03917.33
5.5.70.0030.03917.27
5.5.60.0000.05017.34
5.5.50.0000.04117.25
5.5.40.0020.04917.41
5.5.30.0070.04217.24
5.5.20.0020.04817.32
5.5.10.0060.03917.15
5.5.00.0030.03817.11
5.4.450.0020.04615.31
5.4.440.0060.04515.33
5.4.430.0000.04715.49
5.4.420.0050.03915.27
5.4.410.0030.04715.18
5.4.400.0090.03715.02
5.4.390.0030.03815.26
5.4.380.0060.04115.09
5.4.370.0030.04415.19
5.4.360.0080.02515.33
5.4.350.0020.04015.31
5.4.340.0050.03015.26
5.4.330.0030.01011.56
5.4.320.0060.04315.28
5.4.310.0020.04515.07
5.4.300.0050.04015.20
5.4.290.0080.04014.94
5.4.280.0020.03515.20
5.4.270.0080.04315.19
5.4.260.0070.04115.17
5.4.250.0030.04115.15
5.4.240.0020.04614.95
5.4.230.0030.04415.18
5.4.220.0020.04815.11
5.4.210.0100.03315.10
5.4.200.0090.04214.96
5.4.190.0070.03915.01
5.4.180.0000.04215.25
5.4.170.0040.04215.18
5.4.160.0000.03515.22
5.4.150.0050.02715.18
5.4.140.0020.04313.73
5.4.130.0060.03813.69
5.4.120.0000.03413.82
5.4.110.0050.04213.73
5.4.100.0050.03713.85
5.4.90.0030.04213.84
5.4.80.0030.04313.76
5.4.70.0030.03213.97
5.4.60.0020.03913.87
5.4.50.0050.04013.79
5.4.40.0060.03513.79
5.4.30.0070.04013.75
5.4.20.0050.02313.86
5.4.10.0070.03613.70
5.4.00.0050.02813.58
5.3.290.0020.04412.86
5.3.280.0060.04012.60
5.3.270.0050.03012.69
5.3.260.0100.03712.85
5.3.250.0100.02512.70
5.3.240.0020.04612.78
5.3.230.0030.04512.64
5.3.220.0070.03812.70
5.3.210.0050.04212.50
5.3.200.0080.02012.65
5.3.190.0020.04512.60
5.3.180.0080.03812.78
5.3.170.0020.04212.82
5.3.160.0030.04012.72
5.3.150.0020.04212.79
5.3.140.0050.04512.78
5.3.130.0070.03812.75
5.3.120.0050.04012.75
5.3.110.0050.03712.57
5.3.100.0010.04412.46
5.3.90.0040.04212.35
5.3.80.0040.04012.41
5.3.70.0000.04312.36
5.3.60.0050.04012.34
5.3.50.0050.04112.51
5.3.40.0080.03512.35
5.3.30.0020.03912.31
5.3.20.0050.03212.18
5.3.10.0020.04012.11
5.3.00.0000.03012.12
5.2.170.0000.06711.18
5.2.160.0000.05711.18
5.2.150.0000.05711.26
5.2.140.0030.05711.29
5.2.130.0000.06711.17
5.2.120.0130.05011.13
5.2.110.0070.04011.12
5.2.100.0000.04711.02
5.2.90.0000.06311.07
5.2.80.0100.06011.39
5.2.70.0070.04311.34
5.2.60.0030.06311.17
5.2.50.0070.05711.07
5.2.40.0070.05311.05
5.2.30.0000.06310.99
5.2.20.0030.05711.11
5.2.10.0030.03710.92
5.2.00.0030.04010.67
5.1.60.0000.05010.27
5.1.50.0030.02710.27
5.1.40.0000.05310.27
5.1.30.0000.03710.37
5.1.20.0070.03010.29
5.1.10.0000.05710.27
5.1.00.0030.05010.27
5.0.50.0000.03710.27
5.0.40.0070.03710.27
5.0.30.0000.07010.27
5.0.20.0070.04310.27
5.0.10.0030.04710.27
5.0.00.0030.06310.27
4.4.90.0030.03310.27
4.4.80.0030.02010.27
4.4.70.0070.04310.27
4.4.60.0070.03310.27
4.4.50.0000.02710.27
4.4.40.0030.04710.27
4.4.30.0000.03010.27
4.4.20.0000.03010.27
4.4.10.0000.02310.27
4.4.00.0130.03310.27
4.3.110.0000.04010.27
4.3.100.0030.03710.27
4.3.90.0030.02310.27
4.3.80.0000.04010.27
4.3.70.0030.03010.27
4.3.60.0000.03710.27
4.3.50.0000.04310.27
4.3.40.0100.04310.27
4.3.30.0000.02710.27
4.3.20.0000.04310.27
4.3.10.0000.04010.27
4.3.00.0030.03710.27

preferences:
57.64 ms | 400 KiB | 5 Q