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]; echo $step;die(); } 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.0150.00418.68
8.3.50.0110.00722.05
8.3.40.0120.00318.91
8.3.30.0070.00719.36
8.3.20.0070.00020.20
8.3.10.0040.00423.74
8.3.00.0090.00019.05
8.2.180.0190.00016.88
8.2.170.0110.00322.96
8.2.160.0100.00722.25
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0050.00321.04
8.2.110.0090.00022.22
8.2.100.0040.00717.97
8.2.90.0030.00517.75
8.2.80.0060.00318.86
8.2.70.0060.00618.05
8.2.60.0030.00618.28
8.2.50.0030.00618.10
8.2.40.0030.00619.42
8.2.30.0040.00419.42
8.2.20.0000.00717.90
8.2.10.0070.00018.20
8.2.00.0000.00717.86
8.1.280.0100.00725.92
8.1.270.0060.00318.95
8.1.260.0040.00826.35
8.1.250.0030.00528.09
8.1.240.0000.00923.92
8.1.230.0040.00717.89
8.1.220.0040.00417.77
8.1.210.0050.00318.77
8.1.200.0000.01017.48
8.1.190.0030.00617.47
8.1.180.0090.00019.02
8.1.170.0060.00318.67
8.1.160.0000.00819.11
8.1.150.0000.00718.85
8.1.140.0040.00417.54
8.1.130.0030.00317.76
8.1.120.0050.00217.44
8.1.110.0090.00317.41
8.1.100.0000.00717.54
8.1.90.0020.00517.42
8.1.80.0000.00717.44
8.1.70.0030.00317.54
8.1.60.0100.00017.52
8.1.50.0040.00417.46
8.1.40.0040.00417.66
8.1.30.0050.00317.71
8.1.20.0040.00417.70
8.1.10.0000.00817.63
8.1.00.0000.00717.49
8.0.300.0050.00218.77
8.0.290.0040.00416.88
8.0.280.0000.00718.55
8.0.270.0040.00417.40
8.0.260.0030.00317.26
8.0.250.0000.00717.08
8.0.240.0050.00217.10
8.0.230.0000.00717.15
8.0.220.0050.00317.04
8.0.210.0030.00317.07
8.0.200.0000.00617.09
8.0.190.0040.00417.18
8.0.180.0070.00317.04
8.0.170.0000.00717.05
8.0.160.0070.00017.04
8.0.150.0040.00417.07
8.0.140.0080.00017.02
8.0.130.0070.00813.54
8.0.120.0000.00816.96
8.0.110.0000.00816.98
8.0.100.0040.00416.98
8.0.90.0020.00517.09
8.0.80.0040.01117.03
8.0.70.0000.00716.93
8.0.60.0070.00017.05
8.0.50.0030.00517.15
8.0.30.0140.00817.34
8.0.20.0110.01017.40
8.0.10.0050.00217.03
8.0.00.0100.01016.99
7.4.330.0030.00315.26
7.4.320.0000.00616.74
7.4.300.0030.00316.73
7.4.290.0030.00316.70
7.4.280.0000.00816.68
7.4.270.0070.00016.68
7.4.260.0060.00316.52
7.4.250.0040.00416.58
7.4.240.0020.00516.71
7.4.230.0030.00316.75
7.4.220.0060.01216.73
7.4.210.0120.00316.73
7.4.200.0070.00016.49
7.4.160.0090.00616.72
7.4.150.0080.01217.40
7.4.140.0090.00917.86
7.4.130.0090.01216.61
7.4.120.0060.01016.58
7.4.110.0100.01616.75
7.4.100.0110.00716.50
7.4.90.0170.00016.78
7.4.80.0060.01319.39
7.4.70.0120.00616.68
7.4.60.0070.01016.76
7.4.50.0060.00316.68
7.4.40.0090.01316.49
7.4.30.0120.00316.64
7.4.10.0060.01114.95
7.4.00.0060.01215.10
7.3.330.0000.00513.56
7.3.320.0050.00013.51
7.3.310.0030.00316.36
7.3.300.0030.00316.52
7.3.290.0100.00816.49
7.3.280.0050.01016.49
7.3.270.0110.00817.40
7.3.260.0160.00616.41
7.3.250.0110.00516.61
7.3.240.0150.00316.66
7.3.230.0070.01016.69
7.3.210.0110.00816.60
7.3.200.0100.01319.39
7.3.190.0080.00816.64
7.3.180.0110.00616.61
7.3.170.0060.01216.67
7.3.160.0080.00816.63
7.3.130.0060.01014.80
7.3.120.0070.01114.87
7.3.110.0060.01014.90
7.3.100.0060.00814.92
7.3.90.0050.00814.88
7.3.80.0070.00614.82
7.3.70.0060.00714.87
7.3.60.0070.00814.76
7.3.50.0060.00814.88
7.3.40.0050.00714.78
7.3.30.0090.00514.78
7.3.20.0080.00816.64
7.3.10.0030.01116.76
7.3.00.0030.00916.76
7.2.330.0100.00716.78
7.2.320.0090.00816.84
7.2.310.0030.01416.92
7.2.300.0070.01016.89
7.2.290.0040.01716.85
7.2.260.0120.00615.20
7.2.250.0060.01115.13
7.2.240.0080.01015.26
7.2.230.0060.00815.00
7.2.220.0080.00514.99
7.2.210.0040.01114.99
7.2.200.0040.00915.14
7.2.190.0080.00815.00
7.2.180.0090.00515.03
7.2.170.0070.00715.07
7.2.160.0030.00715.18
7.2.150.0070.00417.06
7.2.140.0110.00416.73
7.2.130.0060.01017.07
7.2.120.0040.01117.15
7.2.110.0030.00916.99
7.2.100.0070.00416.90
7.2.90.0060.00917.05
7.2.80.0030.01216.96
7.2.70.0040.01116.88
7.2.60.0010.01116.91
7.2.50.0090.00616.98
7.2.40.0060.00616.96
7.2.30.0120.00316.88
7.2.20.0030.01216.62
7.2.10.0070.00416.96
7.2.00.0050.00618.35
7.1.330.0070.00715.85
7.1.320.0050.00715.91
7.1.310.0080.00715.88
7.1.300.0050.01115.84
7.1.290.0060.00715.77
7.1.280.0070.00615.84
7.1.270.0050.00815.78
7.1.260.0060.00915.84
7.1.250.0120.00616.05
7.1.240.0030.00715.89
7.1.230.0030.00915.54
7.1.220.0040.01115.74
7.1.210.0030.00715.71
7.1.200.0050.00615.87
7.1.190.0000.01415.90
7.1.180.0060.00915.98
7.1.170.0060.00615.64
7.1.160.0000.00815.50
7.1.150.0040.01115.97
7.1.140.0000.01015.63
7.1.130.0130.00015.73
7.1.120.0110.00315.82
7.1.110.0000.01315.93
7.1.100.0250.00915.63
7.1.90.0070.01015.91
7.1.80.0000.01215.84
7.1.70.0040.00816.43
7.1.60.0080.00817.43
7.1.50.0060.00916.33
7.1.40.0090.00615.98
7.1.30.0000.01015.88
7.1.20.0030.00715.60
7.1.10.0040.00415.80
7.1.00.0050.04319.11
7.0.330.0090.00315.46
7.0.320.0040.00915.23
7.0.310.0040.00415.54
7.0.300.0100.00315.38
7.0.290.0000.01315.20
7.0.280.0000.01115.46
7.0.270.0070.00415.14
7.0.260.0040.00915.20
7.0.250.0100.00315.16
7.0.240.0100.00315.64
7.0.230.0100.00315.46
7.0.220.0060.00315.44
7.0.210.0030.00915.14
7.0.200.0010.00816.13
7.0.190.0040.01415.64
7.0.180.0100.00715.30
7.0.170.0090.00915.39
7.0.160.0090.00315.24
7.0.150.0030.01015.28
7.0.140.0030.03018.75
7.0.130.0000.00815.48
7.0.120.0050.00515.54
7.0.110.0060.00715.31
7.0.100.0080.00015.29
7.0.90.0000.00915.48
7.0.80.0100.00315.47
7.0.70.0000.00915.48
7.0.60.0090.02717.66
7.0.50.0030.04216.73
7.0.40.0050.05316.83
7.0.30.0120.04816.82
7.0.20.0120.04816.91
7.0.10.0090.02116.87
7.0.00.0070.04116.87
5.6.400.0070.00314.24
5.6.390.0070.00714.45
5.6.380.0050.00814.36
5.6.370.0000.00914.70
5.6.360.0060.00314.40
5.6.350.0090.00314.22
5.6.340.0060.01014.73
5.6.330.0120.00314.80
5.6.320.0060.01314.25
5.6.310.0030.01314.45
5.6.300.0060.00914.73
5.6.290.0100.00014.51
5.6.280.0060.03817.74
5.6.270.0040.00814.51
5.6.260.0070.00714.50
5.6.250.0090.00614.47
5.6.240.0030.00614.59
5.6.230.0100.00314.23
5.6.220.0060.00314.43
5.6.210.0110.02617.42
5.6.200.0100.04416.29
5.6.190.0030.02517.43
5.6.180.0210.04117.34
5.6.170.0200.03317.65
5.6.160.0030.02817.45
5.6.150.0070.02116.37
5.6.140.0100.04316.18
5.6.130.0090.04016.34
5.6.120.0080.04517.71
5.6.110.0060.03517.69
5.6.100.0080.04717.63
5.6.90.0090.04017.83
5.6.80.0070.02817.48
5.6.70.0090.00614.29
5.6.60.0080.00814.42
5.6.50.0000.01514.13
5.6.40.0090.00614.52
5.6.30.0030.00914.32
5.6.20.0060.00814.52
5.6.10.0040.01214.40
5.6.00.0070.00714.31
5.5.380.0060.00614.26
5.5.370.0080.00014.33
5.5.360.0110.00414.49
5.5.350.0170.03517.48
5.5.340.0090.02416.29
5.5.330.0130.03617.46
5.5.320.0150.02517.40
5.5.310.0080.02317.36
5.5.300.0050.04516.18
5.5.290.0050.04616.24
5.5.280.0090.04317.73
5.5.270.0060.04417.49
5.5.260.0070.02317.53
5.5.250.0050.02217.39
5.5.240.0080.02217.22
5.5.230.0080.00314.25
5.5.220.0060.00614.37
5.5.210.0060.00814.31
5.5.200.0060.00914.36
5.5.190.0100.00314.21
5.5.180.0080.00814.22
5.5.170.0080.00414.25
5.5.160.0030.01214.29
5.5.150.0030.00914.09
5.5.140.0090.00614.47
5.5.130.0040.01214.59
5.5.120.0070.00714.39
5.5.110.0100.00614.50
5.5.100.0030.01014.48
5.5.90.0040.01114.21
5.5.80.0000.01214.33
5.5.70.0060.01313.95
5.5.60.0080.00314.20
5.5.50.0080.00814.50
5.5.40.0090.00614.59
5.5.30.0030.01014.46
5.5.20.0030.00714.29
5.5.10.0030.00914.04
5.5.00.0120.00314.34
5.4.450.0080.02515.34
5.4.440.0100.01815.29
5.4.430.0130.02015.30
5.4.420.0100.02215.24
5.4.410.0100.02715.30
5.4.400.0150.02815.16
5.4.390.0130.03815.17
5.4.380.0120.03915.15
5.4.370.0150.02315.28
5.4.360.0100.03414.91
5.4.350.0110.02115.20
5.4.340.0150.03315.29
5.4.330.0000.01110.92
5.4.320.0100.02114.96
5.4.310.0100.04215.03
5.4.300.0150.02715.10
5.4.290.0150.03515.06
5.4.280.0150.04015.10
5.4.270.0130.02515.10
5.4.260.0110.02815.00
5.4.250.0160.03615.06
5.4.240.0160.03815.00
5.4.230.0180.03515.27
5.4.220.0180.03515.06
5.4.210.0130.03715.24
5.4.200.0110.02515.24
5.4.190.0120.03615.19
5.4.180.0150.03514.98
5.4.170.0150.03215.11
5.4.160.0110.02815.24
5.4.150.0120.02315.16
5.4.140.0120.02113.68
5.4.130.0160.01813.86
5.4.120.0100.03813.76
5.4.110.0100.04213.71
5.4.100.0120.04213.73
5.4.90.0130.03813.95
5.4.80.0130.04013.74
5.4.70.0150.02513.93
5.4.60.0200.01813.84
5.4.50.0160.02813.89
5.4.40.0220.03213.83
5.4.30.0220.01713.79
5.4.20.0120.03113.74
5.4.10.0150.01813.77
5.4.00.0130.03113.64
5.3.290.0200.06714.84
5.3.280.0270.07314.76
5.3.270.0230.07314.69
5.3.260.0270.03714.52
5.3.250.0230.05014.61
5.3.240.0230.05314.54
5.3.230.0200.05714.61
5.3.220.0300.04014.48
5.3.210.0170.05314.49
5.3.200.0300.05314.50
5.3.190.0400.05014.68
5.3.180.0300.03714.73
5.3.170.0230.05714.63
5.3.160.0130.07314.66
5.3.150.0400.05314.73
5.3.140.0200.07314.65
5.3.130.0200.06714.46
5.3.120.0300.07014.57
5.3.110.0270.05314.53
5.3.100.0270.06314.02
5.3.90.0330.05013.95
5.3.80.0200.03314.04
5.3.70.0070.05013.93
5.3.60.0130.03713.91
5.3.50.0130.05313.87
5.3.40.0100.07714.01
5.3.30.0130.04713.93
5.3.20.0270.05013.80
5.3.10.0270.06313.80
5.3.00.0130.05013.80
5.2.170.0200.05713.80
5.2.160.0130.03313.80
5.2.150.0100.02713.80
5.2.140.0200.06013.80
5.2.130.0130.05313.80
5.2.120.0200.05713.80
5.2.110.0130.06313.80
5.2.100.0170.05713.80
5.2.90.0200.04713.80
5.2.80.0130.04013.80
5.2.70.0270.05013.80
5.2.60.0100.05313.80
5.2.50.0200.06013.80
5.2.40.0200.05313.80
5.2.30.0200.06013.80
5.2.20.0130.05313.80
5.2.10.0170.05013.80
5.2.00.0130.06013.80
5.1.60.0130.05313.80
5.1.50.0200.03713.80
5.1.40.0100.03013.80
5.1.30.0170.03013.80
5.1.20.0200.04313.80
5.1.10.0230.04013.80
5.1.00.0030.04713.80
5.0.50.0030.05013.80
5.0.40.0100.04313.80
5.0.30.0030.06313.80
5.0.20.0130.03013.80
5.0.10.0070.04313.80
5.0.00.0030.06313.80
4.4.90.0070.02713.80
4.4.80.0070.02313.80
4.4.70.0070.03013.80
4.4.60.0100.02313.80
4.4.50.0100.02713.80
4.4.40.0030.04313.80
4.4.30.0030.03013.80
4.4.20.0070.02713.80
4.4.10.0100.02013.80
4.4.00.0130.04013.80
4.3.110.0030.04013.80
4.3.100.0070.03313.80
4.3.90.0070.03313.80
4.3.80.0070.04713.80
4.3.70.0070.03713.80
4.3.60.0030.03313.80
4.3.50.0100.03013.80
4.3.40.0070.05013.80
4.3.30.0030.03713.80
4.3.20.0030.03013.80
4.3.10.0070.03313.80
4.3.00.0030.03313.80

preferences:
34.81 ms | 401 KiB | 5 Q