3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dates = ['20240228', '20240229', '20240301']; $text = ''; foreach ($dates as $i => $date) { $date = new DateTime($date); $month = $date->format('F'); $day = $date->format('j'); $pos = strpos($text, $month); if ($pos !== false) { $text = substr_replace($text, ", $day", $pos - 1, 0); } else { $text .= ($text ? ' & ' : '') . "$day $month"; } } echo $text;

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.20
8.5.10.0110.00716.84
8.5.00.0130.00820.30
8.4.160.0070.01420.42
8.4.150.0010.00014.05
8.4.140.0140.00717.58
8.4.130.0130.00817.82
8.4.120.0130.00620.62
8.4.110.0110.00922.32
8.4.100.0140.00717.90
8.4.90.0090.00718.95
8.4.80.0050.00318.00
8.4.70.0120.00817.84
8.4.60.0050.00320.43
8.4.50.0030.00518.64
8.4.40.0120.00917.78
8.4.30.0140.00718.89
8.4.20.0110.00719.70
8.4.10.0000.00819.74
8.3.290.0150.00620.62
8.3.280.0100.01018.59
8.3.270.0110.00916.71
8.3.260.0110.00716.62
8.3.250.0040.00618.83
8.3.240.0120.00716.64
8.3.230.0070.00516.59
8.3.220.0100.00917.25
8.3.210.0040.00418.78
8.3.200.0130.00716.64
8.3.190.0110.00717.12
8.3.180.0100.00818.52
8.3.170.0170.00020.47
8.3.160.0060.01217.48
8.3.150.0120.00617.50
8.3.140.0070.00716.91
8.3.130.0040.00716.61
8.3.120.0060.00320.48
8.3.110.0090.00920.94
8.3.100.0100.00024.06
8.3.90.0150.00426.77
8.3.80.0060.00317.97
8.3.70.0070.01418.55
8.3.60.0140.00416.58
8.3.50.0200.00316.60
8.3.40.0070.01321.73
8.3.30.0070.01420.05
8.3.20.0180.00323.41
8.3.10.0100.01023.48
8.3.00.0120.00920.79
8.2.300.0120.00920.46
8.2.290.0110.00820.35
8.2.280.0070.01118.35
8.2.270.0060.00318.92
8.2.260.0030.00618.27
8.2.250.0050.00318.65
8.2.240.0030.00518.71
8.2.230.0110.00022.58
8.2.220.0000.00937.54
8.2.210.0080.00026.77
8.2.200.0030.00616.75
8.2.190.0130.01016.58
8.2.180.0080.00818.29
8.2.170.0150.00619.07
8.2.160.0110.00722.96
8.2.150.0110.00721.05
8.2.140.0120.00922.16
8.2.130.0070.01422.16
8.2.120.0120.00621.03
8.2.110.0110.00721.13
8.2.100.0110.00720.83
8.2.90.0160.00320.82
8.2.80.0090.00921.22
8.2.70.0100.01020.75
8.2.60.0110.00720.75
8.2.50.0110.00720.86
8.2.40.0120.00420.81
8.2.30.0090.00620.68
8.2.20.0090.00620.63
8.2.10.0000.01620.81
8.2.00.0030.01320.85
8.1.340.0130.00721.61
8.1.330.0150.00319.93
8.1.320.0120.00816.29
8.1.310.0140.00418.20
8.1.300.0050.00320.04
8.1.290.0140.00030.84
8.1.280.0120.00625.92
8.1.270.0090.00623.96
8.1.260.0100.00723.85
8.1.250.0140.00423.79
8.1.240.0130.00620.61
8.1.230.0090.00920.47
8.1.220.0040.01420.82
8.1.210.0070.01120.65
8.1.200.0030.01420.54
8.1.190.0150.00020.60
8.1.180.0070.00720.41
8.1.170.0090.00620.57
8.1.160.0120.00320.53
8.1.150.0080.00820.50
8.1.140.0150.00020.52
8.1.130.0070.00720.52
8.1.120.0030.01320.64
8.1.110.0090.00620.58
8.1.100.0130.00320.38
8.1.90.0000.01820.32
8.1.80.0120.00621.39
8.1.70.0130.00320.32
8.1.60.0080.00820.66
8.1.50.0090.00620.54
8.1.40.0080.01220.57
8.1.30.0160.00320.65
8.1.20.0130.00621.62
8.1.10.0040.01420.65
8.1.00.0110.00420.52

preferences:
32.25 ms | 403 KiB | 5 Q