3v4l.org

run code in 300+ PHP versions simultaneously
<?php function range_string_to_array($range_string) { $range_string = trim($range_string); $return_array = array(); $return = array(); $range_string = str_replace(',', '+', $range_string); $range_string = str_replace(' ', '+', $range_string); if (is_numeric($range_string)) { return array($range_string); } $split_array = explode('+', $range_string); foreach ($split_array as $split1) { if ($split1 === '') { continue; } if (strpos($split1, '-') > -1) { $split = explode('-', $split1); if ($split[0] === '' && $split[1] === '') { continue; } $step = 1; if (floor($split[0]) != $split[0]) { $return_array[] = $split[0]; $split[0] = floor($split[0]) + 1; } if (floor($split[1]) != $split[1]) { $return_array[] = $split[1]; $split[1] = floor($split[1]); } $return_array[] = $split[0]; foreach (range(floor($split[0]) + 1, $split[1], $step) as $split2) { $return_array[] = $split2; } } else { $return_array[] = $split1; } } foreach ($return_array as $return_array_val) { if (is_numeric($return_array_val)) { $return[] = $return_array_val; } } $return = array_unique($return); sort($return); return $return; } print_r(range_string_to_array('155.5-157.6'));

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.40.0030.01218.96
8.3.30.0110.00319.21
8.3.20.0090.00020.24
8.3.10.0050.00323.78
8.3.00.0020.00519.26
8.2.170.0110.00422.96
8.2.160.0030.01222.20
8.2.150.0030.00524.18
8.2.140.0000.00824.66
8.2.130.0030.00526.16
8.2.120.0070.00021.11
8.2.110.0040.00420.48
8.2.100.0060.00617.97
8.2.90.0030.00617.75
8.2.80.0000.00818.90
8.2.70.0060.00318.16
8.2.60.0050.00318.34
8.2.50.0040.00418.10
8.2.40.0080.00019.30
8.2.30.0000.00819.38
8.2.20.0000.00717.84
8.2.10.0040.00418.34
8.2.00.0040.00417.91
8.1.270.0030.00618.76
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00324.00
8.1.230.0060.00622.88
8.1.220.0050.00317.79
8.1.210.0040.00418.77
8.1.200.0000.00917.35
8.1.190.0040.00417.48
8.1.180.0040.00419.01
8.1.170.0050.00318.71
8.1.160.0000.00719.12
8.1.150.0040.00418.90
8.1.140.0000.00817.48
8.1.130.0000.00717.80
8.1.120.0000.00717.48
8.1.110.0030.00617.46
8.1.100.0070.00017.59
8.1.90.0000.00717.45
8.1.80.0040.00417.48
8.1.70.0070.00017.44
8.1.60.0000.00817.58
8.1.50.0080.00017.56
8.1.40.0040.00417.63
8.1.30.0000.00917.77
8.1.20.0040.00417.65
8.1.10.0040.00417.67
8.1.00.0040.00417.46
8.0.300.0040.00418.77
8.0.290.0060.00316.88
8.0.280.0070.00018.46
8.0.270.0030.00317.32
8.0.260.0070.00017.34
8.0.250.0000.00717.06
8.0.240.0030.00516.95
8.0.230.0080.00017.09
8.0.220.0000.00716.99
8.0.210.0050.00316.90
8.0.200.0030.00617.05
8.0.190.0030.00516.96
8.0.180.0070.00317.02
8.0.170.0000.00816.92
8.0.160.0070.00016.99
8.0.150.0030.00617.02
8.0.140.0000.00816.98
8.0.130.0000.00513.36
8.0.120.0030.00617.00
8.0.110.0000.01016.91
8.0.100.0040.00416.93
8.0.90.0040.00416.87
8.0.80.0000.01617.07
8.0.70.0000.00817.05
8.0.60.0020.00516.87
8.0.50.0080.00016.94
8.0.30.0070.01317.10
8.0.20.0170.00817.40
8.0.10.0050.00217.05
8.0.00.0100.00816.79
7.4.330.0060.00015.15
7.4.320.0000.00716.63
7.4.300.0030.00316.54
7.4.290.0000.00816.61
7.4.280.0000.00816.66
7.4.270.0000.00716.52
7.4.260.0000.00916.61
7.4.250.0000.00716.64
7.4.240.0020.00616.59
7.4.230.0030.00316.61
7.4.220.0100.00716.53
7.4.210.0110.00616.62
7.4.200.0070.00016.68
7.4.160.0080.00816.50
7.4.150.0130.01217.40
7.4.140.0040.01417.86
7.4.130.0110.00616.71
7.4.120.0060.01116.80
7.4.110.0090.01316.49
7.4.100.0080.00816.62
7.4.90.0070.01016.46
7.4.80.0070.01119.39
7.4.70.0110.01016.60
7.4.60.0110.00716.62
7.4.50.0000.00416.54
7.4.40.0120.00816.71
7.4.30.0070.00816.44
7.4.00.0040.01414.91
7.3.330.0000.00613.27
7.3.320.0000.00613.37
7.3.310.0090.00016.43
7.3.300.0000.00616.44
7.3.290.0070.01016.48
7.3.280.0050.01016.46
7.3.270.0090.00917.40
7.3.260.0160.00716.78
7.3.250.0100.00716.59
7.3.240.0120.01216.36
7.3.230.0190.00316.43
7.3.210.0090.01016.41
7.3.200.0120.01319.39
7.3.190.0120.00316.61
7.3.180.0100.00716.45
7.3.170.0060.01216.42
7.3.160.0130.00416.57
7.2.330.0070.01016.57
7.2.320.0070.01116.78
7.2.310.0070.01416.84
7.2.300.0120.00916.78
7.2.290.0110.00616.73
7.2.00.0040.00819.15
7.1.200.0070.00715.79
7.1.100.0830.00716.15
7.1.70.0040.00417.00
7.1.60.0040.01919.22
7.1.50.0070.01616.82
7.1.00.0070.07022.43
7.0.200.0040.00416.82
7.0.140.0030.03322.18
7.0.60.0030.05320.06
7.0.50.0070.06717.80
7.0.40.0000.09020.19
7.0.30.0530.04320.25
7.0.20.0370.07020.26
7.0.10.0100.08020.07
7.0.00.0100.07320.11
5.6.280.0070.07021.01
5.6.210.0170.07020.67
5.6.200.0100.07318.13
5.6.190.0130.07320.61
5.6.180.4000.04320.41
5.6.170.0200.04720.44
5.6.160.0030.04720.50
5.6.150.0070.06018.17
5.6.140.0070.08018.23
5.6.130.0030.08018.17
5.6.120.0030.07320.91
5.6.110.0100.08321.13
5.6.100.0030.06720.90
5.6.90.0070.08721.02
5.6.80.0070.08020.39
5.6.70.0370.07320.41
5.5.350.0030.08020.47
5.5.340.0070.07017.96
5.5.330.0100.04720.40
5.5.320.0130.09020.36
5.5.310.0430.07020.35
5.5.300.0030.04318.07
5.5.290.0030.08317.99
5.5.280.0130.07720.78
5.5.270.0130.05320.69
5.5.260.0100.04320.77
5.5.250.0100.07720.70
5.5.240.0030.06020.21
5.4.450.0570.06019.40
5.4.440.0730.06019.50
5.4.430.0130.05719.41
5.4.420.0900.05019.50
5.4.410.0800.06319.26
5.4.400.0770.05018.89
5.4.390.0170.05318.73
5.4.380.0200.05018.80
5.4.370.0230.04718.48
5.4.360.0230.04718.63
5.4.350.0100.06718.46
5.4.340.0200.05018.81
5.4.320.0230.04718.64
5.4.310.0300.04018.82
5.4.300.0230.04718.57
5.4.290.0200.05018.54
5.4.280.0130.06018.45
5.4.270.0130.06318.74
5.4.260.0370.05318.72
5.4.250.0300.05018.79
5.4.240.0130.07018.72
5.4.230.0170.05718.61
5.4.220.0130.06318.82
5.4.210.0200.05718.55
5.4.200.0300.05316.63
5.4.190.0230.04718.61
5.4.180.0170.05718.73
5.4.170.0130.06018.73
5.4.160.0200.06718.70
5.4.150.0170.05318.72
5.4.140.0270.05716.45
5.4.130.0230.04316.46
5.4.120.0200.04716.15
5.4.110.0270.04716.21
5.4.100.0230.04716.34
5.4.90.0230.04716.29
5.4.80.0200.06316.32
5.4.70.0130.07316.41
5.4.60.0170.05016.16
5.4.50.0300.04016.20
5.4.40.0230.05716.28
5.4.30.0030.06716.29
5.4.20.0270.04016.15
5.4.10.0230.05316.26
5.4.00.0130.05015.75
5.3.290.0200.06014.88
5.3.280.0100.06014.71
5.3.270.0130.07014.61
5.3.260.0100.06014.67
5.3.250.0270.04314.62
5.3.240.0170.05314.72
5.3.230.0130.05714.78
5.3.220.0130.05714.68
5.3.210.0070.06314.77
5.3.200.0130.05314.76
5.3.190.0200.05014.71
5.3.180.0200.05014.58
5.3.170.0170.05314.60
5.3.160.0200.04714.61
5.3.150.0170.05014.62
5.3.140.0200.05014.79
5.3.130.0270.04714.60
5.3.120.0100.07314.62
5.3.110.0170.05314.62
5.3.100.0170.05014.20
5.3.90.0170.05014.22
5.3.80.0100.06014.07
5.3.70.0230.04714.04
5.3.60.0130.06314.14
5.3.50.0230.04714.13
5.3.40.0200.05014.13
5.3.30.0130.06014.13
5.3.20.0170.06313.79
5.3.10.0200.06313.70
5.3.00.0230.06713.77
5.2.170.0230.03711.29
5.2.160.0170.05311.14
5.2.150.0270.04711.27
5.2.140.0130.04311.38
5.2.130.0170.04011.14
5.2.120.0200.03711.35
5.2.110.0200.03711.17
5.2.100.0070.04711.16
5.2.90.0170.04011.15
5.2.80.0100.04711.21
5.2.70.0130.04311.09
5.2.60.0130.04311.12
5.2.50.0170.04311.10
5.2.40.0170.04011.05
5.2.30.0130.04011.01
5.2.20.0130.04011.03
5.2.10.0070.04310.88
5.2.00.0100.04010.84
5.1.60.0170.03010.00
5.1.50.0100.03710.20
5.1.40.0100.03710.06
5.1.30.0070.04010.54
5.1.20.0000.04710.40
5.1.10.0170.03310.29
5.1.00.0130.03310.13
5.0.50.0030.0338.63
5.0.40.0070.0308.47
5.0.30.0030.0478.34
5.0.20.0070.0278.34
5.0.10.0100.0278.31
5.0.00.0030.0478.38
4.4.90.0070.0235.98
4.4.80.0100.0236.02
4.4.70.0030.0235.96
4.4.60.0000.0275.91
4.4.50.0070.0206.05
4.4.40.0130.0275.95
4.4.30.0000.0275.90
4.4.20.0130.0176.00
4.4.10.0030.0276.07
4.4.00.0030.0375.95
4.3.110.0100.0175.84
4.3.100.0030.0235.88
4.3.90.0100.0175.83
4.3.80.0070.0335.84
4.3.70.0030.0235.82
4.3.60.0070.0205.88
4.3.50.0070.0305.89
4.3.40.0100.0305.87
4.3.30.0070.0204.79
4.3.20.0170.0204.79
4.3.10.0030.0234.79
4.3.00.0100.0237.23

preferences:
46.22 ms | 400 KiB | 5 Q