3v4l.org

run code in 300+ PHP versions simultaneously
<?php $lookup = array_flip(['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']); $months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Sep', 'Oct', 'Dec']; $result = []; foreach ($months as $i => $month) { if ($i && $lookup[$month] === $lookup[$months[$i - 1]] + 1) { $ref = strtok($ref, "-") . "-$month"; } else { unset($ref); $ref = $month; $result[] = &$ref; } } var_export($result);

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.00.0130.00820.02
8.4.150.0030.00014.05
8.4.140.0130.00817.32
8.4.130.0040.00417.63
8.4.120.0100.01020.38
8.4.110.0140.00519.43
8.4.100.0120.00817.98
8.4.90.0040.00520.93
8.4.80.0130.00819.55
8.4.70.0140.00617.70
8.4.60.0090.01120.38
8.4.50.0110.01017.83
8.4.40.0100.01020.54
8.4.30.0140.00418.62
8.4.20.0070.01322.27
8.4.10.0090.00623.69
8.3.280.0130.00618.49
8.3.270.0100.00916.59
8.3.260.0080.01216.85
8.3.250.0140.00518.95
8.3.240.0060.01016.80
8.3.230.0100.01116.77
8.3.220.0110.00819.01
8.3.210.0050.00316.56
8.3.200.0050.00416.46
8.3.190.0040.00417.12
8.3.180.0130.00617.41
8.3.170.0070.01118.88
8.3.160.0090.00916.85
8.3.150.0110.00719.06
8.3.140.0120.00617.34
8.3.130.0080.00018.49
8.3.120.0030.00520.62
8.3.110.0090.00020.94
8.3.100.0000.00824.06
8.3.90.0130.00626.77
8.3.80.0090.00017.97
8.3.70.0130.00716.63
8.3.60.0180.00318.30
8.3.50.0040.01116.45
8.3.40.0070.01320.09
8.3.30.0090.00918.71
8.3.20.0000.00824.18
8.3.10.0070.00024.66
8.3.00.0040.00426.16
8.2.290.0120.00716.87
8.2.280.0040.00418.41
8.2.270.0040.01418.81
8.2.260.0130.00616.29
8.2.250.0030.00618.59
8.2.240.0050.00318.95
8.2.230.0140.00422.58
8.2.220.0070.01337.54
8.2.210.0060.00326.77
8.2.200.0110.00018.54
8.2.190.0070.01116.67
8.2.180.0070.01016.48
8.2.170.0120.00622.96
8.2.160.0070.00722.96
8.2.150.0040.00425.66
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0050.00320.90
8.2.110.0030.00620.52
8.2.100.0040.00717.91
8.2.90.0000.00818.34
8.2.80.0000.00818.16
8.2.70.0080.00017.50
8.2.60.0060.00317.48
8.2.50.0180.00019.52
8.2.40.0150.00419.52
8.2.30.0190.00019.52
8.2.20.0160.00419.52
8.2.10.0180.00519.52
8.2.00.0120.00619.52
8.1.330.0100.00815.90
8.1.320.0120.00616.11
8.1.310.0040.00418.51
8.1.300.0120.00620.36
8.1.290.0100.00030.84
8.1.280.0090.00925.92
8.1.270.0040.00422.14
8.1.260.0040.00426.35
8.1.250.0050.00228.09
8.1.240.0030.00623.86
8.1.230.0090.00320.93
8.1.220.0080.00017.79
8.1.210.0090.00018.77
8.1.200.0070.00317.35
8.1.190.0080.00317.13
8.1.180.0080.00819.52
8.1.170.0100.00519.52
8.1.160.0120.00519.52
8.1.150.0120.00619.52
8.1.140.0120.00419.52
8.1.130.0040.01219.52
8.1.120.0080.00819.52
8.1.110.0160.00019.52
8.1.100.0170.00019.52
8.1.90.0140.00319.52
8.1.80.0080.00819.52
8.1.70.0090.00619.52
8.1.60.0070.01119.52
8.1.50.0180.00019.52
8.1.40.0150.00419.52
8.1.30.0130.00719.52
8.1.20.0090.00919.52
8.1.10.0140.00319.52
8.1.00.0170.00319.52
8.0.300.0040.00419.98
8.0.290.0060.00316.58
8.0.280.0120.00419.52
8.0.270.0170.00019.52
8.0.260.0110.00819.52
8.0.250.0110.00719.52
8.0.240.0090.00919.52
8.0.230.0140.00419.52
8.0.220.0100.00819.52
8.0.210.0090.00919.52
8.0.200.0170.00319.52
8.0.190.0090.00919.52
8.0.180.0120.00619.52
8.0.170.0080.00819.52
8.0.160.0130.00319.52
8.0.150.0080.00819.52
8.0.140.0100.00719.52
8.0.130.0100.00719.52
8.0.120.0170.00019.52
8.0.110.0100.00519.52
8.0.100.0120.00419.52
8.0.90.0080.00819.52
8.0.80.0040.01319.52
8.0.70.0110.00519.52
8.0.60.0170.00019.52
8.0.50.0170.00019.52
8.0.30.0110.00619.52
8.0.20.0080.00819.52
8.0.10.0160.00019.52

preferences:
111.57 ms | 403 KiB | 5 Q