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]) { // Decimals if (floor($split[1]) == $split[1]) { $split[1] = floor($split[0]) . '.' . $split[1]; } $step = explode('.', $split[0])[1]; } foreach (range($split[0], $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-177'));

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.60.0130.00618.55
8.3.50.0100.00821.92
8.3.40.0090.00618.79
8.3.30.0090.00519.34
8.3.20.0090.00020.04
8.3.10.0040.00423.66
8.3.00.0030.00619.32
8.2.180.0120.00616.47
8.2.170.0030.01122.96
8.2.160.0100.00722.13
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0050.00326.16
8.2.120.0040.00421.15
8.2.110.0070.00420.66
8.2.100.0110.00018.03
8.2.90.0000.00817.73
8.2.80.0030.00618.90
8.2.70.0090.00318.18
8.2.60.0060.00318.28
8.2.50.0080.00018.10
8.2.40.0000.00819.61
8.2.30.0050.00219.48
8.2.20.0040.00417.95
8.2.10.0000.00718.20
8.2.00.0040.00417.96
8.1.280.0110.01125.92
8.1.270.0060.00318.95
8.1.260.0080.00826.35
8.1.250.0040.00428.09
8.1.240.0080.00323.92
8.1.230.0090.00319.78
8.1.220.0030.00517.89
8.1.210.0000.00818.77
8.1.200.0060.00317.48
8.1.190.0000.00817.35
8.1.180.0040.00419.09
8.1.170.0000.01018.64
8.1.160.0040.00419.07
8.1.150.0000.00719.00
8.1.140.0000.00717.59
8.1.130.0040.00417.89
8.1.120.0070.00017.49
8.1.110.0000.01117.44
8.1.100.0070.00017.61
8.1.90.0030.00417.63
8.1.80.0040.00417.52
8.1.70.0000.00717.56
8.1.60.0090.00017.63
8.1.50.0080.00017.57
8.1.40.0030.00617.50
8.1.30.0080.00017.70
8.1.20.0040.00417.71
8.1.10.0070.00017.64
8.1.00.0050.00317.50
8.0.300.0000.00818.77
8.0.290.0050.00317.00
8.0.280.0070.00018.41
8.0.270.0000.00717.35
8.0.260.0000.00717.27
8.0.250.0070.00017.02
8.0.240.0000.00717.10
8.0.230.0070.00017.12
8.0.220.0000.00717.01
8.0.210.0030.00317.05
8.0.200.0000.00617.01
8.0.190.0040.00417.12
8.0.180.0000.00817.07
8.0.170.0070.00017.10
8.0.160.0000.00817.02
8.0.150.0040.00717.02
8.0.140.0000.00717.00
8.0.130.0000.00613.41
8.0.120.0000.00817.04
8.0.110.0000.00717.12
8.0.100.0040.00416.94
8.0.90.0000.00817.02
8.0.80.0030.01317.10
8.0.70.0000.00717.05
8.0.60.0060.00317.11
8.0.50.0000.00716.96
8.0.30.0130.00817.27
8.0.20.0090.01217.40
8.0.10.0020.00517.18
8.0.00.0070.01117.01
7.4.330.0020.00215.14
7.4.320.0070.00016.70
7.4.300.0030.00316.58
7.4.290.0070.00016.59
7.4.280.0000.00716.59
7.4.270.0080.00016.61
7.4.260.0030.00616.52
7.4.250.0070.00016.42
7.4.240.0000.00716.66
7.4.230.0030.00316.64
7.4.220.0030.01416.56
7.4.210.0110.01016.69
7.4.200.0000.00716.72
7.4.160.0090.00616.64
7.4.150.0120.01217.40
7.4.140.0100.00817.86
7.4.130.0100.01116.66
7.4.120.0120.00516.63
7.4.110.0100.01016.65
7.4.100.0080.01216.50
7.4.90.0090.01216.59
7.4.80.0030.01419.39
7.4.70.0110.01116.48
7.4.60.0070.01016.46
7.4.50.0000.00816.77
7.4.40.0160.00016.57
7.4.30.0070.01016.67
7.4.00.0030.01414.83
7.3.330.0050.00013.38
7.3.320.0030.00313.49
7.3.310.0070.00016.32
7.3.300.0030.00316.35
7.3.290.0120.00216.51
7.3.280.0110.00716.45
7.3.270.0130.01017.40
7.3.260.0110.00816.57
7.3.250.0100.00816.58
7.3.240.0040.01316.66
7.3.230.0070.01016.72
7.3.210.0160.00716.36
7.3.200.0190.00219.39
7.3.190.0100.00716.54
7.3.180.0100.01016.52
7.3.170.0070.01016.67
7.3.160.0100.00716.53
7.3.120.0000.01614.93
7.3.110.0090.00914.71
7.3.100.0040.01214.76
7.3.90.0030.00614.88
7.3.80.0000.00915.07
7.3.70.0060.00714.66
7.3.60.0030.01314.78
7.3.50.0060.00914.97
7.3.40.0000.00914.54
7.3.30.0040.00714.94
7.3.20.0070.00716.52
7.3.10.0060.00316.91
7.3.00.0090.00316.67
7.2.330.0060.01216.75
7.2.320.0030.01716.93
7.2.310.0070.01016.82
7.2.300.0130.00716.77
7.2.290.0090.01216.68
7.2.250.0090.00915.07
7.2.240.0090.01215.16
7.2.230.0070.01015.30
7.2.220.0000.00915.32
7.2.210.0000.01415.09
7.2.200.0030.01314.95
7.2.190.0090.00414.99
7.2.180.0040.01514.84
7.2.170.0040.01114.94
7.2.60.0030.01216.72
7.2.00.0040.01119.44
7.1.330.0060.00615.80
7.1.320.0040.00815.72
7.1.310.0100.00015.71
7.1.300.0090.00615.84
7.1.290.0000.01415.75
7.1.280.0030.00615.52
7.1.270.0070.00715.88
7.1.260.0040.01115.66
7.1.200.0050.00615.64
7.1.100.0450.00615.77
7.1.70.0000.00817.07
7.1.60.0130.01619.22
7.1.50.0100.01016.98
7.1.00.0030.07322.48
7.0.200.0040.00416.86
7.0.140.0070.04322.10
7.0.60.0030.04019.83
7.0.50.0100.04317.88
7.0.40.0100.08020.30
7.0.30.0200.05320.23
7.0.20.0230.08020.33
7.0.10.0000.04720.16
7.0.00.0100.06320.14
5.6.280.0070.06321.11
5.6.210.0030.08720.52
5.6.200.0000.05318.24
5.6.190.0070.09020.42
5.6.180.0330.07020.39
5.6.170.0270.04720.73
5.6.160.0100.04720.45
5.6.150.0100.03718.18
5.6.140.0100.05718.29
5.6.130.0070.04318.14
5.6.120.0200.05321.13
5.6.110.0100.07721.03
5.6.100.0030.07721.08
5.6.90.0200.04021.14
5.6.80.0030.04020.41
5.5.350.0330.06720.35
5.5.340.0130.04718.08
5.5.330.0130.08320.22
5.5.320.0430.07020.24
5.5.310.0270.03320.51
5.5.300.0030.05018.04
5.5.290.0100.05017.97
5.5.280.0170.03020.67
5.5.270.0030.08020.79
5.5.260.0230.06320.91
5.5.250.0130.04320.52
5.5.240.0030.07720.38
5.4.450.0100.06019.18
5.4.440.0700.07019.59
5.4.430.0730.04719.32
5.4.420.0800.06019.47
5.4.410.0800.04319.16
5.4.400.0800.05718.89
5.4.390.0200.05018.72
5.4.380.0230.05318.66
5.4.370.0200.05018.55
5.4.360.0270.04318.59
5.4.350.0200.05718.78
5.4.340.0130.06018.58
5.4.320.0170.05718.48
5.4.310.0170.05318.70
5.4.300.0230.04718.51
5.4.290.0330.04018.48
5.4.280.0100.06018.72
5.4.270.0100.06018.74
5.4.260.0130.05718.46
5.4.250.0030.06718.61
5.4.240.0070.06318.77
5.4.230.0200.04718.69
5.4.220.0200.05018.74
5.4.210.0170.05318.60
5.4.200.0100.05716.78
5.4.190.0300.04018.82
5.4.180.0130.05718.82
5.4.170.0270.04718.49
5.4.160.0230.05018.74
5.4.150.0200.05718.61
5.4.140.0200.06316.32
5.4.130.0230.06016.30
5.4.120.0100.05716.20
5.4.110.0170.06716.22
5.4.100.0170.05316.30
5.4.90.0230.05716.45
5.4.80.0270.05716.35
5.4.70.0230.04716.25
5.4.60.0230.04316.42
5.4.50.0230.04716.20
5.4.40.0170.05316.18
5.4.30.0300.04016.27
5.4.20.0430.04716.27
5.4.10.0170.05016.15
5.4.00.0200.04715.89
5.3.290.0230.04714.80
5.3.280.0170.05314.64
5.3.270.0230.05314.84
5.3.260.0230.04714.84
5.3.250.0170.06714.75
5.3.240.0170.07014.66
5.3.230.0100.06014.64
5.3.220.0170.05014.63
5.3.210.0170.05314.74
5.3.200.0270.04014.68
5.3.190.0170.05014.58
5.3.180.0170.05014.61
5.3.170.0230.04314.59
5.3.160.0100.05714.70
5.3.150.0230.05014.61
5.3.140.0130.05314.54
5.3.130.0170.05014.69
5.3.120.0200.05014.77
5.3.110.0170.05714.69
5.3.100.0300.03714.25
5.3.90.0200.04714.03
5.3.80.0170.05014.13
5.3.70.0200.04714.01
5.3.60.0170.05014.18
5.3.50.0130.05314.00
5.3.40.0130.05013.98
5.3.30.0200.04713.98
5.3.20.0170.04713.74
5.3.10.0270.03713.72
5.3.00.0200.04713.72
5.2.170.0230.03311.20
5.2.160.0130.05311.28
5.2.150.0030.05311.38
5.2.140.0130.04711.25
5.2.130.0070.04711.22
5.2.120.0130.03711.21
5.2.110.0100.04311.17
5.2.100.0170.03311.15
5.2.90.0170.03711.10
5.2.80.0230.03711.11
5.2.70.0170.04011.21
5.2.60.0130.04011.16
5.2.50.0130.05011.23
5.2.40.0100.04011.04
5.2.30.0200.03311.09
5.2.20.0130.03711.07
5.2.10.0030.04710.98
5.2.00.0230.03310.77
5.1.60.0130.03010.03
5.1.50.0030.04010.04
5.1.40.0130.03010.09
5.1.30.0100.03710.45
5.1.20.0100.03710.49
5.1.10.0130.03710.12
5.1.00.0170.03010.20
5.0.50.0100.0278.77
5.0.40.0030.0308.56
5.0.30.0030.0538.32
5.0.20.0100.0278.32
5.0.10.0000.0338.27
5.0.00.0030.0478.25
4.4.90.0030.0235.93
4.4.80.0000.0275.93
4.4.70.0070.0205.93
4.4.60.0070.0235.99
4.4.50.0070.0206.00
4.4.40.0030.0375.89
4.4.30.0100.0235.93
4.4.20.0070.0236.00
4.4.10.0030.0235.95
4.4.00.0070.0335.93
4.3.110.0030.0235.88
4.3.100.0030.0235.81
4.3.90.0100.0175.80
4.3.80.0100.0305.90
4.3.70.0030.0235.83
4.3.60.0070.0205.91
4.3.50.0070.0205.86
4.3.40.0100.0305.81
4.3.30.0070.0204.75
4.3.20.0030.0234.75
4.3.10.0030.0234.75
4.3.00.0170.0277.30

preferences:
51.86 ms | 401 KiB | 5 Q