3v4l.org

run code in 300+ PHP versions simultaneously
<?php setlocale(LC_ALL, 'UTF-8'); date_default_timezone_set('America/Sao_Paulo'); $datestring = ''; $monthago = ''; $monthsago = ''; $period = new DatePeriod( new DateTime('-3 months'), DateInterval::createFromDateString('first day of next month'), new DateTime('NOW') ); $months = array(); foreach ($period as $p) $months[] = strftime('%B', $p->getTimestamp()); if(array_search("January",$months) >= 1){ $months = str_replace("January","Janeiro",$months); if ($months[3] == "Janeiro") { $datestring = '0115'; } if ($months[2] == "Janeiro") { $lastmonth = "0115"; } if ($months[1] == "Janeiro") { $monthsago = "0115"; } }elseif(array_search("February",$months) >= 1){ $months = str_replace("February","Fevereiro",$months); if ($months[3] == "Fevereiro") { $datestring = "0215"; } if ($months[2] == "Fevereiro") { $lastmonth = "0215"; } if ($months[1] == "Fevereiro") { $monthsago = "0215"; } }elseif(array_search("March",$months) >= 1){ $months = str_replace("March","Março",$months); if ($months[3] == "Março") { $datestring = "0315"; } if ($months[2] == "Março") { $lastmonth = "0315"; } if ($months[1] == "Março") { $monthsago = "0315"; } }elseif(array_search("April",$months) >= 1){ $months = str_replace("April","Abril",$months); if ($months[3] == "Abril") { $datestring = "0415"; } if ($months[2] == "Abril") { $lastmonth = "0415"; } if ($months[1] == "Abril") { $monthsago = "0415"; } }elseif(array_search("May",$months) >= 1){ $months = str_replace("May","Maio",$months); if ($months[3] == "Maio") { $datestring = "0515"; } if ($months[2] == "Maio") { $lastmonth = "0515"; } if ($months[1] == "Maio") { $monthsago = "0515"; } }elseif(array_search("June",$months) >= 1){ $months = str_replace("June","Junho",$months); if ($months[3] == "Junho") { $datestring = "0615"; } if ($months[2] == "Junho") { $lastmonth = "0615"; } if ($months[1] == "Junho") { $monthsago = "0615"; } }elseif(array_search("July",$months) >= 1){ $months = str_replace("July","Julho",$months); if ($months[3] == "Julho") { $datestring = "0715"; } if ($months[2] == "Julho") { $lastmonth = "0715"; } if ($months[1] == "Julho") { $monthsago = "0715"; } }elseif(array_search("August",$months) >= 1){ $months = str_replace("August","Agosto",$months); if ($months[3] == "Agosto") { $datestring = "0815"; } if ($months[2] == "Agosto") { $lastmonth = "0815"; } if ($months[1] == "Agosto") { $monthsago = "0815"; } }elseif(array_search("September",$months) >= 1){ $months = str_replace("September","Setembro",$months); if ($months[3] == "Setembro") { $datestring = "0915"; } if ($months[2] == "Setembro") { $lastmonth = "0915"; } if ($months[1] == "Setembro") { $monthsago = "0915"; } }elseif(array_search("October",$months) >= 1){ $months = str_replace("October","Outubro",$months); if ($months[3] == "Outubro") { $datestring = "1015"; } if ($months[2] == "Outubro") { $lastmonth = "1015"; } if ($months[1] == "Outubro") { $monthsago = "1015"; } }elseif(array_search("November",$months) >= 1){ $months = str_replace("November","Novembro",$months); if ($months[3] == "Novembro") { $datestring = "1115"; } if ($months[2] == "Novembro") { $lastmonth = "1115"; } if ($months[1] == "Novembro") { $monthsago = "1115"; } }elseif(array_search("December",$months) >= 1){ $months = str_replace("December","Dezembro",$months); if ($months[3] == "Dezembro") { $datestring = "1215"; } if ($months[2] == "Dezembro") { $lastmonth = "1215"; } if ($months[1] == "Dezembro") { $monthsago = "1215"; } } echo $months[1]. '-' . $monthago; ?>

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.0120.00916.87
8.3.50.0100.01022.05
8.3.40.0150.00019.09
8.3.30.0040.01119.35
8.3.20.0040.00420.29
8.3.10.0030.00621.89
8.3.00.0040.00420.95
8.2.180.0040.01218.54
8.2.170.0130.00322.96
8.2.160.0070.01422.16
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00019.91
8.2.110.0030.00621.18
8.2.100.0120.00018.29
8.2.90.0080.00018.53
8.2.80.0000.00818.03
8.2.70.0030.00618.13
8.2.60.0030.00518.18
8.2.50.0040.00418.28
8.2.40.0060.00320.86
8.2.30.0000.00818.33
8.2.20.0080.00018.16
8.2.10.0050.00318.25
8.2.00.0060.00318.23
8.1.280.0150.00425.92
8.1.270.0060.00319.20
8.1.260.0080.00026.35
8.1.250.0050.00328.09
8.1.240.0060.00622.29
8.1.230.0060.00621.14
8.1.220.0040.00418.02
8.1.210.0000.00820.32
8.1.200.0050.00517.50
8.1.190.0040.00417.73
8.1.180.0040.00418.10
8.1.170.0070.00318.89
8.1.160.0040.00422.24
8.1.150.0070.00419.12
8.1.140.0000.00817.82
8.1.130.0040.00418.14
8.1.120.0000.00717.81
8.1.110.0000.00817.84
8.1.100.0030.00617.88
8.1.90.0040.00417.67
8.1.80.0000.00717.78
8.1.70.0040.00417.71
8.1.60.0030.00617.95
8.1.50.0030.00517.85
8.1.40.0000.00817.72
8.1.30.0060.00317.89
8.1.20.0030.00517.95
8.1.10.0040.00417.90
8.1.00.0030.00617.76
8.0.300.0020.00520.41
8.0.290.0040.00417.13
8.0.280.0030.00318.84
8.0.270.0030.00317.56
8.0.260.0000.00717.66
8.0.250.0000.00717.25
8.0.240.0000.00717.25
8.0.230.0040.00417.42
8.0.220.0070.00017.17
8.0.210.0050.00217.33
8.0.200.0030.00317.29
8.0.190.0090.00017.39
8.0.180.0040.00417.41
8.0.170.0040.00417.38
8.0.160.0000.00817.23
8.0.150.0000.00717.29
8.0.140.0070.00017.16
8.0.130.0060.00313.75
8.0.120.0040.00417.24
8.0.110.0040.00417.23
8.0.100.0000.00817.18
8.0.90.0000.00817.37
8.0.80.0090.00917.36
8.0.70.0050.00217.15
8.0.60.0040.00417.33
8.0.50.0060.00317.17
8.0.30.0140.01017.50
8.0.20.0140.00917.48
8.0.10.0060.00317.44
8.0.00.0100.01017.13
7.4.330.0030.00315.19
7.4.320.0060.00016.87
7.4.300.0040.00416.88
7.4.290.0040.00416.94
7.4.280.0040.00416.87
7.4.270.0000.00716.91
7.4.260.0050.00216.83
7.4.250.0040.00416.74
7.4.240.0040.00416.89
7.4.230.0050.00317.07
7.4.220.0100.01017.00
7.4.210.0070.00716.85
7.4.200.0050.00216.75
7.4.160.0090.00616.81
7.4.150.0040.01717.40
7.4.140.0080.01017.86
7.4.130.0100.01017.04
7.4.120.0130.00516.99
7.4.110.0060.01217.05
7.4.100.0060.01316.96
7.4.90.0160.00616.80
7.4.80.0100.00719.39
7.4.70.0060.01116.92
7.4.60.0140.00716.89
7.4.50.0000.00816.71
7.4.40.0040.01217.17
7.4.30.0110.00717.04
7.4.00.0130.00315.24
7.3.330.0000.00713.49
7.3.320.0000.00613.45
7.3.310.0000.00716.61
7.3.300.0070.00016.68
7.3.290.0080.00716.68
7.3.280.0100.00916.65
7.3.270.0160.00617.40
7.3.260.0070.01016.80
7.3.250.0120.01216.84
7.3.240.0060.01316.80
7.3.230.0120.01216.84
7.3.210.0100.00717.02
7.3.200.0130.01119.39
7.3.190.0090.00916.67
7.3.180.0070.01017.01
7.3.170.0090.00916.86
7.3.160.0060.01016.87
7.2.330.0090.00917.05
7.2.320.0100.01016.78
7.2.310.0110.00617.15
7.2.300.0100.00617.33
7.2.290.0120.00617.11
7.2.60.0100.00317.34
7.1.200.0060.01316.09
7.1.70.0080.00017.50
7.1.60.0040.01117.63
7.1.50.0030.01717.03
7.1.00.0000.08022.36
7.0.200.0100.00016.93
7.0.140.0030.05322.13
7.0.100.0000.08720.00
7.0.90.0070.05020.02
7.0.80.0130.07720.02
7.0.70.0130.03720.03
7.0.60.0030.08020.06
7.0.50.0070.07720.45
7.0.40.0100.08020.10
7.0.30.0100.07020.01
7.0.20.0130.07320.07
7.0.10.0130.08019.99
7.0.00.0200.07320.04
5.6.280.0100.06721.09
5.6.250.0100.07020.81
5.6.240.0070.04720.55
5.6.230.0170.06020.74
5.6.220.0100.04320.57
5.6.210.0170.06720.82
5.6.200.0100.07020.99
5.6.190.0070.06321.16
5.6.180.0100.07721.17
5.6.170.0000.07321.16
5.6.160.0030.08721.22
5.6.150.0030.08721.10
5.6.140.0130.06321.11
5.6.130.0130.08021.09
5.6.120.0100.08721.14
5.6.110.0030.07721.07
5.6.100.0070.08021.17
5.6.90.0170.07721.14
5.6.80.0130.06720.48
5.6.70.0100.08020.53
5.6.60.0100.08020.50
5.6.50.0030.08320.42
5.6.40.0100.06020.35
5.6.30.0130.07320.45
5.6.20.0000.07320.49
5.6.10.0030.05320.41
5.6.00.0100.08020.44
5.5.380.0070.07720.50
5.5.370.0070.07020.41
5.5.360.0130.05020.40
5.5.350.0100.06720.47
5.5.340.0030.08020.92
5.5.330.0000.08720.97
5.5.320.0130.06720.79
5.5.310.0200.07320.93
5.5.300.0000.07720.79
5.5.290.0100.08020.86
5.5.280.0130.06320.98
5.5.270.0070.08720.85
5.5.260.0270.06720.91
5.5.250.0070.05020.77
5.5.240.0030.07720.07
5.5.230.0100.06020.18
5.5.220.0230.05320.23
5.5.210.0070.04020.19
5.5.200.0100.08320.28
5.5.190.0100.04320.26
5.5.180.0130.07720.27
5.5.160.0030.08020.05
5.5.150.0030.08320.31
5.5.140.0100.07720.32
5.5.130.0170.07020.18
5.5.120.0070.08020.26
5.5.110.0070.07720.28
5.5.100.0100.07720.15
5.5.90.0170.07320.11
5.5.80.0170.07020.02
5.5.70.0070.07720.08
5.5.60.0070.07320.01
5.5.50.0100.07320.11
5.5.40.0100.08020.10
5.5.30.0100.06020.13
5.5.20.0170.06720.10
5.5.10.0030.04720.02
5.5.00.0130.07019.97
5.4.450.0130.07319.37
5.4.440.0100.04319.11
5.4.430.0030.06319.40
5.4.420.0100.05719.36
5.4.410.0130.07719.11
5.4.400.0000.04318.95
5.4.390.0070.04019.03
5.4.380.0130.06719.10
5.4.370.0100.05718.91
5.4.360.0070.07319.12
5.4.350.0130.04719.03
5.4.340.0000.07019.07
5.4.320.0000.08719.10
5.4.310.0100.06719.03
5.4.300.0070.07719.12
5.4.290.0130.07019.07
5.4.280.0070.07719.11
5.4.270.0070.06318.99
5.4.260.0070.07719.07
5.4.250.0130.06319.02
5.4.240.0070.07719.07
5.4.230.0030.08019.22
5.4.220.0070.05319.09
5.4.210.0070.07019.14
5.4.200.0070.07719.14
5.4.190.0070.07718.95
5.4.180.0100.07719.05
5.4.170.0100.05319.23
5.4.160.0070.04319.03
5.4.150.0070.04019.03
5.4.140.0100.07316.42
5.4.130.0070.07716.34
5.4.120.0070.06716.32
5.4.110.0100.06716.38
5.4.100.0000.07716.38
5.4.90.0100.07016.44
5.4.80.0070.07716.25
5.4.70.0100.07016.40
5.4.60.0100.06716.38
5.4.50.0130.06716.21
5.4.40.0100.05716.29
5.4.30.0070.07716.33
5.4.20.0100.06016.41
5.4.10.0100.06716.29
5.4.00.0070.07315.85

preferences:
44.17 ms | 401 KiB | 5 Q