3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dates = ['20240228', '20240229', '20240301']; function formatDates(array $datesInput) { foreach ($datesInput as $datesKey => $date) { $date = new DateTime($date); $month = $date->format('F'); $day = $date->format('j'); if ($datesKey == 0) { $datesOutput = $day; } elseif ($currentMonth <> $month) { $datesOutput .= " $currentMonth & $day"; } else { $datesOutput .= ", $day"; } $currentMonth = $month; } return "$datesOutput $month"; } echo formatDates($dates);

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.5.20.0110.00620.23
8.5.10.0100.00816.98
8.5.00.0090.01320.38
8.4.170.0100.01220.66
8.4.160.0120.01024.07
8.4.150.0020.00014.05
8.4.140.0170.01117.65
8.4.130.0130.00718.07
8.4.120.0140.00622.12
8.4.110.0150.00618.75
8.4.100.0120.01017.99
8.4.90.0150.00420.75
8.4.80.0100.01018.83
8.4.70.0090.00718.88
8.4.60.0140.00518.68
8.4.50.0110.00918.72
8.4.40.0100.01017.82
8.4.30.0130.00619.01
8.4.20.0170.00319.57
8.4.10.0040.00419.35
8.3.290.0080.01220.81
8.3.280.0020.00114.05
8.3.270.0150.00416.79
8.3.260.0120.00816.76
8.3.250.0060.00218.95
8.3.240.0110.00716.69
8.3.230.0130.00716.81
8.3.220.0030.00418.98
8.3.210.0120.00616.77
8.3.200.0040.00416.63
8.3.190.0080.01017.28
8.3.180.0120.00618.79
8.3.170.0100.00720.88
8.3.160.0110.00717.54
8.3.150.0030.00617.15
8.3.140.0110.00717.17
8.3.130.0030.00518.62
8.3.120.0000.01219.16
8.3.110.0040.00420.94
8.3.100.0060.00324.06
8.3.90.0050.00326.77
8.3.80.0030.00617.97
8.3.70.0150.00618.35
8.3.60.0030.01316.81
8.3.50.0070.00716.94
8.3.40.0120.00321.86
8.3.30.0070.00721.98
8.3.20.0170.00323.52
8.3.10.0030.01723.51
8.3.00.0100.01020.79
8.2.300.0120.00818.99
8.2.290.0090.00616.82
8.2.280.0110.00520.07
8.2.270.0080.00018.88
8.2.260.0110.00718.58
8.2.250.0100.00716.83
8.2.240.0040.00417.44
8.2.230.0000.00822.58
8.2.220.0090.00037.54
8.2.210.0040.00426.77
8.2.200.0000.01016.88
8.2.190.0090.00616.88
8.2.180.0110.01116.63
8.2.170.0070.01018.89
8.2.160.0070.00722.96
8.2.150.0140.00020.83
8.2.140.0140.00322.25
8.2.130.0100.00722.28
8.2.120.0130.00321.00
8.2.110.0070.00721.20
8.2.100.0070.00721.00
8.2.90.0080.00820.80
8.2.80.0070.01021.17
8.2.70.0150.00020.76
8.2.60.0110.00720.74
8.2.50.0040.01221.05
8.2.40.0090.00620.64
8.2.30.0060.00920.63
8.2.20.0140.00020.73
8.2.10.0110.00420.67
8.2.00.0120.00320.80
8.1.340.0090.01217.70
8.1.330.0100.00916.23
8.1.320.0110.00818.01
8.1.310.0070.01118.54
8.1.300.0100.01016.09
8.1.290.0060.00330.84
8.1.280.0170.00325.92
8.1.270.0030.01023.79
8.1.260.0070.00723.73
8.1.250.0130.00023.84
8.1.240.0090.00620.57
8.1.230.0080.00820.47
8.1.220.0060.00920.80
8.1.210.0130.00620.55
8.1.200.0060.00920.63
8.1.190.0090.00920.48
8.1.180.0070.01120.38
8.1.170.0040.01120.47
8.1.160.0090.00620.43
8.1.150.0080.00820.59
8.1.140.0060.01120.48
8.1.130.0100.00720.51
8.1.120.0080.00820.54
8.1.110.0140.00020.50
8.1.100.0060.00920.60
8.1.90.0070.00720.41
8.1.80.0090.00921.60
8.1.70.0110.00720.41
8.1.60.0070.00720.72
8.1.50.0120.00320.59
8.1.40.0150.00320.54
8.1.30.0000.01520.82
8.1.20.0070.00721.79
8.1.10.0180.00020.48
8.1.00.0110.00420.53

preferences:
94.42 ms | 403 KiB | 5 Q