3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = strtotime("01-jan-2018"); $next = strtotime("next day", $start); $festivi = array( "Capodanno" => getMyDate("01-jan-2018"), "Epifania" => getMyDate("06-jan-2018"), "Pasqua" => getMyDate("01-apr-2018"), "Pasquetta" => getMyDate("02-apr-2018"), "Liberazione" => getMyDate("25-apr-2018"), "Lavoratori" => getMyDate("01-mag-2018"), "Repubblica" => getMyDate("02-jun-2018"), "Patrono" => getMyDate("29-jun-2018"), "Ferragosto" => getMyDate("15-aug-2018"), "TuttiSanti" => getMyDate("01-nov-2018"), "Immacolata" => getMyDate("08-dic-2018"), "Natale" => getMyDate("25-dic-2018"), "SantoStefano" => getMyDate("26-dic-2018") ); while($start != strtotime("01 jan 2019")){ if(isFestivo($festivi, $start)) echo date('d/m/Y', $start)."\t".$festivo[getFestivoIndex($festivi, $start)]["descrizione"]."\n"; else if(date('w',$start)==6) echo date('d/m/Y', $start)."\tS\n"; else if(date('w',$start)==7) echo date('d/m/Y', $start)."\tD\n"; else $start = strtotime("next day", $start); $start = strtotime("next day", $start); } function getMyDate($myDate){ return date('d/m/Y', strtotime($myDate)); } function isFestivo($festivi, $myDate){ foreach($festivi as $tempDescription => $tempDate) if($myDate == $tempDate) return true; return false; } function getFestivoIndex($festivi,$myDate){ $count = 0; foreach($festivi as $tempDescription => $tempDate) if($myDate == $tempDate) return $count; else $count++; return -1; }

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.70.0150.00618.33
8.3.60.0110.01118.43
8.3.50.0140.01018.36
8.3.40.0100.00718.84
8.3.30.0090.00918.84
8.3.20.0030.00619.32
8.3.10.0050.00521.03
8.3.00.0030.00623.66
8.2.180.0100.01418.25
8.2.170.0040.01422.96
8.2.160.0080.00820.43
8.2.150.0030.00624.18
8.2.140.0030.00724.66
8.2.130.0060.00321.03
8.2.120.0100.00026.35
8.2.110.0080.00320.52
8.2.100.0070.00717.99
8.2.90.0030.00618.16
8.2.80.0060.00318.16
8.2.70.0000.00918.17
8.2.60.0030.00717.93
8.2.50.0070.00318.10
8.2.40.0000.00919.44
8.2.30.0030.00619.75
8.2.20.0060.00618.41
8.2.10.0030.00618.22
8.2.00.0040.00419.64
8.1.280.0130.00725.92
8.1.270.0030.00622.18
8.1.260.0050.00526.35
8.1.250.0030.00628.09
8.1.240.0090.00322.64
8.1.230.0060.00620.91
8.1.220.0030.00617.91
8.1.210.0030.00618.91
8.1.200.0080.00317.63
8.1.190.0030.00617.48
8.1.180.0040.00418.10
8.1.170.0030.01018.72
8.1.160.0060.00319.07
8.1.150.0060.00319.00
8.1.140.0000.01019.71
8.1.130.0030.00619.17
8.1.120.0060.00317.78
8.1.110.0000.01017.68
8.1.100.0050.00517.78
8.1.90.0000.00917.73
8.1.80.0070.00317.65
8.1.70.0090.00317.65
8.1.60.0050.00517.68
8.1.50.0030.00617.76
8.1.40.0050.00517.80
8.1.30.0090.00017.73
8.1.20.0030.00617.93
8.1.10.0040.00817.75
8.1.00.0000.01117.68
8.0.300.0030.00720.11
8.0.290.0040.00817.13
8.0.280.0000.00818.61
8.0.270.0000.00817.38
8.0.260.0000.00917.48
8.0.250.0060.00317.12
8.0.240.0000.01217.16
8.0.230.0030.00617.25
8.0.220.0080.00417.09
8.0.210.0000.01017.19
8.0.200.0000.00817.11
8.0.190.0000.00917.21
8.0.180.0030.00717.15
8.0.170.0080.00317.22
8.0.160.0030.00617.12
8.0.150.0040.00717.13
8.0.140.0030.00717.01
8.0.130.0000.00713.54
8.0.120.0060.00317.17
8.0.110.0030.00617.20
8.0.100.0060.00317.04
8.0.90.0000.00917.14
8.0.80.0140.00917.20
8.0.70.0060.00317.14
8.0.60.0000.00917.06
8.0.50.0000.00916.99
8.0.30.0050.01817.41
8.0.20.0110.01217.41
8.0.10.0000.01017.38
8.0.00.0100.01016.96
7.4.330.0000.00615.55
7.4.320.0020.00516.85
7.4.300.0000.00816.82
7.4.290.0060.00316.81
7.4.280.0030.00716.88
7.4.270.0040.00716.91
7.4.260.0060.00316.64
7.4.250.0030.00616.61
7.4.240.0060.00316.74
7.4.230.0070.00316.86
7.4.220.0040.00716.88
7.4.210.0050.01416.81
7.4.200.0000.01216.77
7.4.160.0090.01416.79
7.4.140.0110.01117.86
7.4.130.0200.00316.85
7.4.120.0110.01316.75
7.4.110.0070.01416.62
7.4.100.0210.00616.82
7.4.90.0100.01016.79
7.4.80.0100.01619.39
7.4.70.0100.01016.80
7.4.60.0070.01116.54
7.4.50.0030.01216.74
7.4.40.0060.01516.78
7.4.00.0070.01215.32
7.3.330.0030.00313.40
7.3.320.0050.00213.50
7.3.310.0040.00716.59
7.3.300.0030.00516.43
7.3.290.0040.00416.54
7.3.280.0100.00716.50
7.3.260.0090.01116.77
7.3.240.0100.01216.69
7.3.230.0090.01216.71
7.3.210.0080.01416.64
7.3.200.0080.01116.62
7.3.190.0170.00816.95
7.3.180.0080.01116.71
7.3.170.0110.01117.01
7.3.160.0160.01316.81
7.3.120.0110.01115.19
7.3.110.0060.01314.98
7.3.100.0070.01015.21
7.3.90.0030.01014.87
7.3.80.0130.00715.00
7.3.70.0090.00915.26
7.3.60.0140.00714.89
7.3.50.0070.01015.24
7.3.40.0030.01015.19
7.3.30.0030.01014.94
7.3.20.0160.00616.94
7.3.10.0070.01316.88
7.3.00.0060.00916.61
7.2.330.0090.01217.11
7.2.320.0060.01316.81
7.2.310.0100.01816.74
7.2.300.0130.00717.14
7.2.290.0140.01616.84
7.2.250.0160.00715.35
7.2.240.0070.01715.13
7.2.230.0030.01515.32
7.2.220.0000.01615.62
7.2.210.0080.00815.21
7.2.200.0040.01415.36
7.2.190.0070.01415.44
7.2.180.0040.01115.34
7.2.170.0090.00615.15
7.2.110.0040.01516.98
7.2.60.0650.00615.11
7.2.50.0540.01014.73
7.2.40.0580.01914.98
7.2.30.0190.00515.21
7.2.20.0380.00615.11
7.2.10.0560.01014.65
7.2.00.0610.00715.19
7.1.330.0070.01015.79
7.1.320.0100.00715.89
7.1.310.0090.00916.12
7.1.300.0040.00815.86
7.1.290.0060.00915.86
7.1.280.0030.00915.78
7.1.270.0120.00915.68
7.1.260.0070.00716.07
7.1.200.0100.00716.09
7.1.170.0620.01013.41
7.1.160.0190.01413.86
7.1.150.0170.00613.76
7.1.140.0560.01013.67
7.1.130.0710.01314.01
7.1.120.0820.00613.70
7.1.110.0490.01314.20
7.1.100.0580.00714.25
7.1.90.0570.01613.85
7.1.80.0680.00313.77
7.1.70.0590.01313.88
7.1.60.0930.01032.23
7.1.50.1070.02031.88
7.1.40.1040.00732.21
7.1.30.1040.01231.67
7.1.20.1000.01031.81
7.1.10.0700.01313.97
7.1.00.0560.00713.94

preferences:
61.83 ms | 400 KiB | 5 Q