3v4l.org

run code in 300+ PHP versions simultaneously
<?php $currentMonth = date("n"); $currentYear = date("Y"); echo $currentMonth . "\n"; echo $currentYear . "\n"; $month = $currentMonth; $year = $currentYear; $firstDayOfTheMonth = mktime(0, 0, 0, $month, 1, $year); $d = getdate($firstDayOfTheMonth); // Vasarnap helyett hetfo az elso nap a heten. $dayOfTheWeekOfFirstDayOfTheMonth = (6 + $d["wday"]) % 7 + 1; $totalDaysInCurrentMonth = date("t"); $kellenekUresNapokAHonapVegen = true; echo $firstDayOfTheMonth . "firstDayOfTheMonth\n"; //echo $d . "d\n"; echo $dayOfTheWeekOfFirstDayOfTheMonth . "dayOfTheWeekOfFirstDayOfTheMonth\n"; echo $totalDaysInCurrentMonth . "totalDaysInCurrentMonth\n"; 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; echo '$day: ' . $day ."\n"; $dateWeek = date("W", mktime(0, 0, 0, $month, $day, $year)); echo '$dateWeek: ' . $dateWeek ."\n"; if (intval(date("W")) > intval($dateWeek)) { echo "CONTINUE1\n"; 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 (intval($dateWeek) > $utolsoJelentkezhetoHet) { $kellenekUresNapokAHonapVegen = false; echo "CONTINUE2\n"; 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>"); } } } else { // TODO(palinko): Kell ez? echo "<td class='noborder'></td>"; } if ($i % 7 == 6) { echo "</tr>"; } } ?>

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.0060.00916.59
8.3.50.0200.01121.99
8.3.40.0060.00918.90
8.3.30.0100.01319.20
8.3.20.0040.00420.38
8.3.10.0040.00423.65
8.3.00.0090.00019.50
8.2.180.0120.00618.63
8.2.170.0000.01522.96
8.2.160.0040.01120.44
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00022.21
8.2.110.0070.00420.72
8.2.100.0090.00318.34
8.2.90.0060.00319.47
8.2.80.0000.00818.13
8.2.70.0050.00518.00
8.2.60.0030.00518.30
8.2.50.0060.00319.73
8.2.40.0080.00018.41
8.2.30.0050.00318.25
8.2.20.0000.00918.04
8.2.10.0040.00418.24
8.2.00.0040.00718.16
8.1.280.0070.00725.92
8.1.270.0060.00323.97
8.1.260.0080.00026.35
8.1.250.0030.00528.09
8.1.240.0090.00024.09
8.1.230.0080.00317.77
8.1.220.0060.00318.02
8.1.210.0030.00518.77
8.1.200.0040.00417.61
8.1.190.0040.00417.79
8.1.180.0090.00018.10
8.1.170.0030.00618.73
8.1.160.0000.00822.16
8.1.150.0000.00818.98
8.1.140.0000.00817.80
8.1.130.0080.00018.03
8.1.120.0000.00817.86
8.1.110.0040.00417.78
8.1.100.0000.00717.83
8.1.90.0000.00717.78
8.1.80.0040.00417.85
8.1.70.0000.00717.65
8.1.60.0040.00417.87
8.1.50.0060.00317.83
8.1.40.0000.00817.71
8.1.30.0000.00817.73
8.1.20.0000.00817.96
8.1.10.0000.00817.78
8.1.00.0040.00417.87
8.0.300.0000.00818.77
8.0.290.0040.00417.13
8.0.280.0000.00718.54
8.0.270.0000.00817.45
8.0.260.0050.00217.38
8.0.250.0000.00817.27
8.0.240.0040.00417.43
8.0.230.0030.00517.39
8.0.220.0040.00417.23
8.0.210.0030.00717.17
8.0.200.0040.00417.38
8.0.190.0090.00017.27
8.0.180.0080.00017.21
8.0.170.0000.00917.33
8.0.160.0070.00017.25
8.0.150.0040.00417.25
8.0.140.0040.00417.26
8.0.130.0050.00213.65
8.0.120.0080.00017.24
8.0.110.0000.00917.19
8.0.100.0000.00717.17
8.0.90.0040.00417.13
8.0.80.0100.00617.29
8.0.70.0000.00817.34
8.0.60.0040.00417.25
8.0.50.0000.00817.20
8.0.30.0160.00417.33
8.0.20.0140.01317.41
8.0.10.0000.00817.45
8.0.00.0090.01017.07
7.4.330.0030.00315.34
7.4.320.0000.00716.95
7.4.300.0070.00016.77
7.4.290.0040.00416.89
7.4.280.0040.00416.78
7.4.270.0040.00416.87
7.4.260.0000.00716.78
7.4.250.0040.00416.87
7.4.240.0000.00716.83
7.4.230.0000.00816.90
7.4.220.0120.00816.98
7.4.210.0110.00616.81
7.4.200.0060.00316.87
7.4.190.0000.00716.74
7.4.160.0150.00416.89
7.4.150.0050.01517.40
7.4.140.0140.00717.86
7.4.130.0050.01316.89
7.4.120.0180.00116.89
7.4.110.0130.00616.87
7.4.100.0090.00916.61
7.4.90.0100.01016.72
7.4.80.0130.01019.39
7.4.70.0000.01916.96
7.4.60.0090.00916.89
7.4.50.0000.00816.84
7.4.40.0060.01222.77
7.4.30.0170.00016.67
7.4.00.0030.01415.38
7.3.330.0050.00013.39
7.3.320.0030.00313.41
7.3.310.0000.00716.64
7.3.300.0040.00416.58
7.3.290.0110.00516.57
7.3.280.0110.00816.63
7.3.270.0100.01017.40
7.3.260.0060.01216.72
7.3.250.0090.01016.66
7.3.240.0090.01416.63
7.3.230.0030.01516.57
7.3.210.0090.00916.92
7.3.200.0100.01419.39
7.3.190.0110.01116.92
7.3.180.0070.01116.66
7.3.170.0060.01316.73
7.3.160.0150.00316.97
7.3.120.0080.00915.19
7.3.110.0090.00815.29
7.3.100.0050.01015.26
7.3.90.0060.00915.10
7.3.80.0090.00715.12
7.3.70.0080.00414.97
7.3.60.0070.00815.12
7.3.50.0050.00715.10
7.3.40.0020.00914.81
7.3.30.0030.00915.10
7.3.20.0070.00616.89
7.3.10.0070.00816.72
7.3.00.0050.01016.83
7.2.330.0100.01016.93
7.2.320.0060.01317.12
7.2.310.0110.00716.95
7.2.300.0120.00917.15
7.2.290.0080.01116.74
7.2.250.0050.01315.40
7.2.240.0060.01315.19
7.2.230.0060.00815.40
7.2.220.0060.00515.21
7.2.210.0080.00715.36
7.2.200.0030.01215.42
7.2.190.0060.00815.33
7.2.180.0010.01215.43
7.2.170.0080.00615.45
7.2.160.0030.01315.08
7.2.150.0070.01117.20
7.2.140.0080.00817.17
7.2.130.0070.00317.18
7.2.120.0100.00717.26
7.2.110.0090.00916.94
7.2.100.0050.00817.26
7.2.90.0070.00717.20
7.2.80.0040.00817.13
7.2.70.0070.01117.23
7.2.60.0060.00617.16
7.2.50.0110.00416.80
7.2.40.0060.01017.13
7.2.30.0110.00716.90
7.2.20.0090.00317.27
7.2.10.0060.00617.14
7.2.00.0080.00417.30
7.1.330.0080.00715.95
7.1.320.0050.00816.13
7.1.310.0050.01015.90
7.1.300.0070.00715.97
7.1.290.0040.00915.98
7.1.280.0050.00815.88
7.1.270.0040.01215.89
7.1.260.0030.00915.92
7.1.250.0120.00315.93
7.1.240.0070.00716.11
7.1.230.0100.00715.83
7.1.220.0030.00616.01
7.1.210.0070.01015.87
7.1.200.0060.00915.94
7.1.190.0070.01116.00
7.1.180.0030.00615.96
7.1.170.0030.00615.98
7.1.160.0110.00016.22
7.1.150.0040.01416.11
7.1.140.0110.00415.95
7.1.130.0030.01016.13
7.1.120.0030.01316.14
7.1.110.0040.00716.05
7.1.100.0000.01015.91
7.1.90.0030.00616.13
7.1.80.0060.01015.98
7.1.70.0060.00816.74
7.1.60.0050.01417.65
7.1.50.0100.00716.55
7.1.40.0030.00615.91
7.1.30.0070.00316.15
7.1.20.0000.01215.98
7.1.10.0040.01116.07
7.1.00.0060.03819.24
7.0.330.0040.01115.61
7.0.320.0070.00415.22
7.0.310.0100.00315.68
7.0.300.0110.00715.53
7.0.290.0070.00715.56
7.0.280.0000.00815.45
7.0.270.0000.00915.56
7.0.260.0080.00815.56
7.0.250.0030.01215.32
7.0.240.0000.00815.39
7.0.230.0070.00315.39
7.0.220.0070.00715.76
7.0.210.0050.00815.72
7.0.200.0130.00615.39
7.0.190.0040.00715.59
7.0.180.0040.01115.66
7.0.170.0000.00915.57
7.0.160.0060.00615.62
7.0.150.0120.00615.64
7.0.140.0020.04018.68
7.0.130.0060.00615.44
7.0.120.0040.00415.49
7.0.110.0050.04517.68
7.0.100.0050.02317.86
7.0.90.0030.05017.82
7.0.80.0110.03917.85
7.0.70.0110.04017.72
7.0.60.0090.03817.73
7.0.50.0050.04418.11
7.0.40.0030.02916.90
7.0.30.0120.02516.86
7.0.20.0080.04216.95
7.0.10.0120.04016.84
7.0.00.0090.04116.82
5.6.400.0090.00014.64
5.6.390.0040.01214.56
5.6.380.0030.01014.81
5.6.370.0060.00614.70
5.6.360.0100.00714.46
5.6.350.0060.00914.53
5.6.340.0060.00614.77
5.6.330.0130.00314.34
5.6.320.0030.01214.78
5.6.310.0070.00314.46
5.6.300.0030.01414.59
5.6.290.0060.00814.54
5.6.280.0020.04517.85
5.6.270.0040.01114.39
5.6.260.0030.01014.39
5.6.250.0050.03317.76
5.6.240.0050.04317.54
5.6.230.0030.03317.54
5.6.220.0130.03817.38
5.6.210.0050.04717.58
5.6.200.0050.04217.86
5.6.190.0090.03817.81
5.6.180.0070.03917.80
5.6.170.0060.04017.78
5.6.160.0110.04317.88
5.6.150.0080.04117.85
5.6.140.0020.04717.72
5.6.130.0070.04517.60
5.6.120.0120.03817.89
5.6.110.0110.02317.80
5.6.100.0050.04417.98
5.6.90.0100.04517.68
5.6.80.0070.02817.46
5.6.70.0100.02917.51
5.6.60.0080.04317.37
5.6.50.0050.04717.45
5.6.40.0030.04717.37
5.6.30.0100.04017.46
5.6.20.0060.03817.51
5.6.10.0050.04317.56
5.6.00.0110.03317.53
5.5.380.0100.03817.60
5.5.370.0030.04817.59
5.5.360.0100.04317.33
5.5.350.0110.04017.42
5.5.340.0070.04517.74
5.5.330.0060.03817.59
5.5.320.0080.03117.68
5.5.310.0080.03617.65
5.5.300.0050.04517.92
5.5.290.0080.03817.58
5.5.280.0140.03617.55
5.5.270.0050.04817.64
5.5.260.0080.03617.68
5.5.250.0020.04017.67
5.5.240.0110.04117.34
5.5.230.0100.03617.28
5.5.220.0050.04517.35
5.5.210.0060.04317.36
5.5.200.0080.03117.39
5.5.190.0020.04917.44
5.5.180.0150.03817.36
5.5.170.0100.00614.48
5.5.160.0050.02317.38
5.5.150.0060.04217.46
5.5.140.0030.04617.24
5.5.130.0110.02217.22
5.5.120.0070.04217.37
5.5.110.0020.04817.25
5.5.100.0070.04017.38
5.5.90.0080.04117.18
5.5.80.0080.02617.38
5.5.70.0080.03817.13
5.5.60.0030.03417.15
5.5.50.0070.03817.07
5.5.40.0070.04417.22
5.5.30.0120.03917.24
5.5.20.0030.02717.38
5.5.10.0080.04017.08
5.5.00.0170.03417.41
5.4.450.0020.03715.14
5.4.440.0020.04515.44
5.4.430.0060.03915.13
5.4.420.0030.02515.18
5.4.410.0090.03615.27
5.4.400.0060.04114.97
5.4.390.0120.03515.12
5.4.380.0030.02815.07
5.4.370.0030.04114.94
5.4.360.0070.02515.28
5.4.350.0020.04315.13
5.4.340.0090.03915.06
5.4.330.0090.00311.07
5.4.320.0060.04015.18
5.4.310.0020.02415.23
5.4.300.0070.03015.01
5.4.290.0050.04315.08
5.4.280.0130.03515.10
5.4.270.0030.04115.16
5.4.260.0030.03815.15
5.4.250.0050.04315.09
5.4.240.0100.03314.99
5.4.230.0090.03715.17
5.4.220.0080.02715.04
5.4.210.0080.03815.15
5.4.200.0030.02914.96
5.4.190.0040.04514.95
5.4.180.0080.01914.95
5.4.170.0030.04215.06
5.4.160.0070.03715.10
5.4.150.0090.03715.08
5.4.140.0030.04113.83
5.4.130.0070.03813.75
5.4.120.0050.04013.88
5.4.110.0090.03313.75
5.4.100.0060.03413.73
5.4.90.0100.03513.83
5.4.80.0050.04313.71
5.4.70.0060.03613.81
5.4.60.0080.03513.79
5.4.50.0030.04313.74
5.4.40.0080.03813.75
5.4.30.0130.02313.67
5.4.20.0080.03813.69
5.4.10.0050.04213.71
5.4.00.0070.03713.39
5.3.290.0070.03812.63
5.3.280.0060.03812.69
5.3.270.0070.04012.63
5.3.260.0030.04112.49
5.3.250.0070.04012.58
5.3.240.0030.04012.70
5.3.230.0040.03212.66
5.3.220.0070.04212.61
5.3.210.0050.02412.51
5.3.200.0000.04412.50
5.3.190.0080.03712.46
5.3.180.0030.02512.61
5.3.170.0030.04312.51
5.3.160.0080.03012.60
5.3.150.0050.04112.56
5.3.140.0070.04012.54
5.3.130.0050.02512.48
5.3.120.0030.04012.35
5.3.110.0110.03512.49
5.3.100.0050.04312.35
5.3.90.0070.03612.37
5.3.80.0030.03812.17
5.3.70.0040.04012.26
5.3.60.0080.03712.12
5.3.50.0000.02912.22
5.3.40.0040.03012.33
5.3.30.0080.03712.28
5.3.20.0020.03912.02
5.3.10.0100.03012.06
5.3.00.0070.04012.03
5.2.170.0170.04711.25
5.2.160.0100.04011.10
5.2.150.0100.06310.96
5.2.140.0100.06011.11
5.2.130.0170.04711.05
5.2.120.0070.06011.13
5.2.110.0100.04711.07
5.2.100.0030.06711.08
5.2.90.0000.06710.92
5.2.80.0130.05711.11
5.2.70.0130.05711.03
5.2.60.0100.06010.99
5.2.50.0100.05011.04
5.2.40.0100.05711.09
5.2.30.0070.06010.94
5.2.20.0030.06310.94
5.2.10.0070.04710.89
5.2.00.0070.03710.70
5.1.60.0070.0509.98
5.1.50.0000.06010.02
5.1.40.0100.05010.07
5.1.30.0100.05310.37
5.1.20.0130.04710.39
5.1.10.0070.05710.07
5.1.00.0030.05710.09
5.0.50.0070.0438.55
5.0.40.0070.0438.42
5.0.30.0070.0608.22
5.0.20.0030.0408.41
5.0.10.0070.0408.21
5.0.00.0130.0478.36
4.4.90.0070.0337.85
4.4.80.0070.0307.85
4.4.70.0000.0377.85
4.4.60.0070.0337.85
4.4.50.0000.0407.85
4.4.40.0030.0507.85
4.4.30.0130.0277.85
4.4.20.0000.0177.85
4.4.10.0000.0277.85
4.4.00.0070.0337.85
4.3.110.0100.0307.85
4.3.100.0000.0377.85
4.3.90.0030.0307.85
4.3.80.0030.0537.85
4.3.70.0070.0307.85
4.3.60.0070.0307.85
4.3.50.0030.0277.85
4.3.40.0000.0437.85
4.3.30.0030.0377.85
4.3.20.0000.0307.85
4.3.10.0030.0377.85
4.3.00.0000.0377.85

preferences:
40.62 ms | 401 KiB | 5 Q