3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'A1-3, A14, 5B-7'; $result = []; foreach (explode(', ', $string) as $value) { if (sscanf($value, '%[A-Z]%d-%d', $letter, $low, $high) === 3) { for ($x = $low; $x <= $high; ++$x) { $result[] = $letter . $x; } } elseif (sscanf($value, '%d%[A-Z]-%d', $low, $letter, $high) === 3) { for ($x = $low; $x <= $high; ++$x) { $result[] = $x . $letter; } } else { $result[] = $value; } } 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.10.0110.00620.11
8.5.00.0150.00719.71
8.4.160.0130.00822.16
8.4.150.0020.00014.05
8.4.140.0140.00717.59
8.4.130.0080.00517.65
8.4.120.0070.00620.31
8.4.110.0130.00718.80
8.4.100.0130.00817.69
8.4.90.0100.01118.61
8.4.80.0120.00819.60
8.4.70.0050.00317.65
8.4.60.0120.00718.53
8.4.50.0140.00720.26
8.4.40.0160.00320.37
8.4.30.0060.01320.88
8.4.20.0090.01219.34
8.4.10.0030.00622.27
8.3.280.0120.00818.48
8.3.270.0210.01016.36
8.3.260.0040.00516.55
8.3.250.0120.00818.69
8.3.240.0140.00616.57
8.3.230.0050.00316.86
8.3.220.0050.00417.42
8.3.210.0080.01016.79
8.3.200.0040.00416.78
8.3.190.0110.00617.43
8.3.180.0120.00716.60
8.3.170.0080.00019.28
8.3.160.0040.01418.54
8.3.150.0120.00618.74
8.3.140.0080.00018.83
8.3.130.0030.00618.37
8.3.120.0040.00419.02
8.3.110.0000.00816.59
8.3.100.0090.00018.49
8.3.90.0070.00726.77
8.3.80.0040.00419.36
8.3.70.0120.00616.73
8.3.60.0100.01018.68
8.3.50.0110.00716.56
8.3.40.0070.00720.34
8.3.30.0090.00618.72
8.3.20.0070.00024.18
8.3.10.0040.00424.66
8.3.00.0110.00426.16
8.2.290.0120.00720.38
8.2.280.0050.00418.14
8.2.270.0150.00317.17
8.2.260.0030.00919.09
8.2.250.0000.00818.28
8.2.240.0040.00417.15
8.2.230.0030.00620.94
8.2.220.0050.00324.06
8.2.210.0040.00426.77
8.2.200.0040.00418.88
8.2.190.0140.00416.58
8.2.180.0110.00318.54
8.2.170.0140.00718.95
8.2.160.0030.01022.96
8.2.150.0040.00425.66
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0080.00020.02
8.2.110.0030.00620.22
8.2.100.0090.00317.72
8.2.90.0060.00317.88
8.2.80.0050.00318.83
8.2.70.0040.00417.50
8.2.60.0000.00918.03
8.2.50.0030.00518.07
8.2.40.0030.00619.82
8.2.30.0040.00418.07
8.2.20.0000.01117.61
8.2.10.0040.00817.79
8.2.00.0090.00317.64
8.1.330.0120.00622.09
8.1.320.0080.00316.30
8.1.310.0110.00716.53
8.1.300.0200.00017.89
8.1.290.0040.00430.84
8.1.280.0110.00425.92
8.1.270.0040.00424.66
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0130.00618.61
8.1.230.0040.00717.65
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0060.00317.35
8.1.190.0030.00517.23
8.1.180.0040.00418.10
8.1.170.0030.00618.84
8.1.160.0000.00718.89
8.1.150.0110.00517.35
8.1.140.0130.00317.42
8.1.130.0130.00417.39
8.1.120.0130.00017.49
8.1.110.0040.00717.53
8.1.100.0090.00317.52
8.1.90.0030.00617.42
8.1.80.0070.00417.53
8.1.70.0000.00917.49
8.1.60.0060.00617.61
8.1.50.0130.00017.55
8.1.40.0150.00017.27
8.1.30.0090.00517.47
8.1.20.0070.00917.52
8.1.10.0110.00317.42
8.1.00.0000.01417.44
8.0.300.0050.00518.77
8.0.290.0040.00416.75
8.0.280.0030.00318.43
8.0.270.0050.00516.74
8.0.260.0120.00016.70
8.0.250.0120.00016.86
8.0.240.0100.00516.87
8.0.230.0160.00016.83
8.0.220.0140.00016.67
8.0.210.0090.00516.63
8.0.200.0140.00316.88
8.0.190.0080.00816.91
8.0.180.0100.00316.72
8.0.170.0000.01116.85
8.0.160.0060.00316.91
8.0.150.0060.00616.79
8.0.140.0090.00616.80
8.0.130.0160.00016.79
8.0.120.0000.01416.74
8.0.110.0090.00516.72
8.0.100.0110.00516.72
8.0.90.0090.00516.75
8.0.80.0160.00516.80
8.0.70.0100.01016.73
8.0.60.0130.00316.69
8.0.50.0170.00016.73
8.0.30.0110.00616.78
8.0.20.0120.00616.86
8.0.10.0140.00016.82

preferences:
121.97 ms | 403 KiB | 5 Q