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.0160.00318.65
8.3.50.0100.01221.98
8.3.40.0040.01118.83
8.3.30.0150.00019.17
8.3.20.0070.00020.47
8.3.10.0040.00423.65
8.3.00.0080.00019.21
8.2.180.0150.00316.88
8.2.170.0070.00722.96
8.2.160.0100.00722.12
8.2.150.0040.00424.18
8.2.140.0030.00524.66
8.2.130.0040.00426.16
8.2.120.0070.00019.79
8.2.110.0030.00617.75
8.2.100.0000.01217.97
8.2.90.0040.00417.88
8.2.80.0080.00018.86
8.2.70.0080.00017.93
8.2.60.0060.00318.34
8.2.50.0050.00318.10
8.2.40.0060.00319.53
8.2.30.0080.00019.28
8.2.20.0030.00517.84
8.2.10.0080.00018.30
8.2.00.0000.00817.84
8.1.280.0130.01325.92
8.1.270.0080.00018.93
8.1.260.0080.00026.35
8.1.250.0060.00328.09
8.1.240.0040.00424.04
8.1.230.0080.00320.97
8.1.220.0000.00817.77
8.1.210.0040.00418.77
8.1.200.0000.00817.48
8.1.190.0030.00517.35
8.1.180.0040.00419.00
8.1.170.0000.00918.78
8.1.160.0000.00719.17
8.1.150.0040.00419.06
8.1.140.0080.00017.53
8.1.130.0030.00317.85
8.1.120.0040.00417.55
8.1.110.0060.00317.54
8.1.100.0040.00417.42
8.1.90.0040.00417.52
8.1.80.0040.00417.53
8.1.70.0070.00017.51
8.1.60.0030.00617.69
8.1.50.0030.00617.61
8.1.40.0000.00817.65
8.1.30.0000.00817.72
8.1.20.0030.00617.76
8.1.10.0040.00417.68
8.1.00.0070.00017.61
8.0.300.0050.00318.77
8.0.290.0030.00616.88
8.0.280.0030.00518.45
8.0.270.0000.00817.22
8.0.260.0030.00317.35
8.0.250.0030.00316.95
8.0.240.0030.00317.07
8.0.230.0000.00717.19
8.0.220.0030.00316.92
8.0.210.0070.00017.05
8.0.200.0060.00017.12
8.0.190.0050.00317.09
8.0.180.0040.00417.04
8.0.170.0040.00417.10
8.0.160.0000.00817.02
8.0.150.0000.00817.01
8.0.140.0030.00516.98
8.0.130.0040.00413.44
8.0.120.0040.00416.99
8.0.110.0040.00417.03
8.0.100.0000.00716.92
8.0.90.0070.00017.16
8.0.80.0150.00617.02
8.0.70.0030.00516.93
8.0.60.0040.00416.99
8.0.50.0070.00016.91
8.0.30.0080.01117.37
8.0.20.0100.01317.40
8.0.10.0030.00517.11
8.0.00.0080.00816.87
7.4.330.0050.00015.15
7.4.320.0030.00316.71
7.4.300.0050.00216.70
7.4.290.0070.00016.68
7.4.280.0040.00416.58
7.4.270.0030.00616.76
7.4.260.0070.00016.64
7.4.250.0040.00416.57
7.4.240.0020.00516.71
7.4.230.0030.00316.43
7.4.220.0100.01016.61
7.4.210.0060.00916.56
7.4.200.0000.00716.79
7.4.160.0120.00316.57
7.4.150.0100.01317.40
7.4.140.0150.00617.86
7.4.130.0110.00916.73
7.4.120.0100.00716.59
7.4.110.0150.00616.77
7.4.100.0130.00416.77
7.4.90.0110.00716.68
7.4.80.0110.01119.39
7.4.70.0110.01116.52
7.4.60.0060.01016.78
7.4.50.0080.00016.73
7.4.40.0150.00716.56
7.4.30.0130.00316.73
7.4.10.0070.01016.43
7.4.00.0080.00715.75
7.3.330.0030.00313.37
7.3.320.0000.00513.44
7.3.310.0000.00716.47
7.3.300.0000.00616.52
7.3.290.0080.00816.47
7.3.280.0080.00916.51
7.3.270.0120.00617.40
7.3.260.0140.01016.53
7.3.250.0100.00716.49
7.3.240.0050.01116.72
7.3.230.0100.01316.74
7.3.210.0060.01316.52
7.3.200.0090.01419.39
7.3.190.0110.00516.45
7.3.180.0140.00316.51
7.3.170.0080.00916.51
7.3.160.0060.01316.60
7.3.130.0100.00716.55
7.3.120.0070.01015.70
7.3.110.0040.01115.74
7.3.100.0060.00615.74
7.3.90.0030.00915.67
7.3.80.0020.00915.80
7.3.70.0110.00315.79
7.3.60.0090.00515.66
7.3.50.0090.00315.62
7.3.40.0030.01015.64
7.3.30.0040.00815.74
7.3.20.0060.00917.49
7.3.10.0040.01117.46
7.3.00.0090.00417.08
7.2.330.0100.00716.72
7.2.320.0060.01116.79
7.2.310.0060.01016.64
7.2.300.0130.01016.73
7.2.290.0030.01416.56
7.2.260.0070.01016.43
7.2.250.0060.01216.77
7.2.240.0090.00715.67
7.2.230.0030.01215.89
7.2.220.0050.01215.96
7.2.210.0050.01115.91
7.2.200.0050.00515.88
7.2.190.0050.00815.84
7.2.180.0070.00615.99
7.2.170.0050.01015.76
7.2.160.0050.00915.92
7.2.150.0090.00717.73
7.2.140.0030.01117.71
7.2.130.0050.00817.49
7.2.120.0060.00817.52
7.2.110.0030.01117.46
7.2.100.0070.00817.31
7.2.90.0100.00317.47
7.2.80.0070.00317.45
7.2.70.0040.00917.54
7.2.60.0060.00717.35
7.2.50.0080.00517.53
7.2.40.0020.01217.42
7.2.30.0050.00817.40
7.2.20.0060.00517.36
7.2.10.0060.00817.46
7.2.00.0080.00818.02
7.1.330.0060.00816.76
7.1.320.0060.00516.74
7.1.310.0000.01316.57
7.1.300.0070.00516.58
7.1.290.0020.00916.63
7.1.280.0030.00816.55
7.1.270.0070.00416.64
7.1.260.0020.01116.69
7.1.250.0040.00816.39
7.1.240.0070.00416.66
7.1.230.0050.00716.58
7.1.220.0030.00916.60
7.1.210.0050.00616.54
7.1.200.0040.00716.20
7.1.190.0020.01016.47
7.1.180.0040.00916.36
7.1.170.0080.00516.67
7.1.160.0060.00316.65
7.1.150.0040.00716.77
7.1.140.0030.01016.49
7.1.130.0080.00616.49
7.1.120.0000.01016.53
7.1.110.0080.00516.75
7.1.100.0190.00816.32
7.1.90.0030.00716.64
7.1.80.0040.00716.59
7.1.70.0020.01016.85
7.1.60.0040.00816.89
7.1.50.0050.01016.75
7.1.40.0000.01216.73
7.1.30.0070.00316.49
7.1.20.0050.00816.69
7.1.10.0090.00416.38
7.1.00.0040.03018.46
7.0.330.0030.00916.18
7.0.320.0030.00916.24
7.0.310.0060.00316.15
7.0.300.0050.00716.12
7.0.290.0030.01016.25
7.0.280.0040.00716.14
7.0.270.0030.01016.37
7.0.260.0090.00216.34
7.0.250.0080.00316.21
7.0.240.0050.01116.31
7.0.230.0070.00716.19
7.0.220.0050.00816.20
7.0.210.0100.00316.14
7.0.200.0060.00616.42
7.0.190.0040.00716.15
7.0.180.0040.00916.38
7.0.170.0040.00616.19
7.0.160.0080.00616.35
7.0.150.0020.00916.37
7.0.140.0050.02118.23
7.0.130.0020.00816.09
7.0.120.0030.00816.17
7.0.110.0080.00316.19
7.0.100.0080.03017.54
7.0.90.0060.02517.40
7.0.80.0020.03217.43
7.0.70.0040.03617.41
7.0.60.0070.03317.50
7.0.50.0020.02817.64
7.0.40.0070.02616.21
7.0.30.0060.01816.11
7.0.20.0040.02316.18
7.0.10.0030.02016.15
7.0.00.0010.02316.23
5.6.400.0100.00316.04
5.6.390.0100.00315.85
5.6.380.0030.00715.37
5.6.370.0020.01015.39
5.6.360.0050.00715.45
5.6.350.0030.00815.26
5.6.340.0050.01215.35
5.6.330.0060.00415.46
5.6.320.0070.00515.40
5.6.310.0060.00815.23
5.6.300.0090.00515.37
5.6.290.0030.00715.12
5.6.280.0060.02917.04
5.6.270.0030.00715.10
5.6.260.0080.00615.33
5.6.250.0030.02017.05
5.6.240.0050.01717.05
5.6.230.0080.02716.88
5.6.220.0070.02016.97
5.6.210.0070.02917.17
5.6.200.0090.02517.16
5.6.190.0070.01717.21
5.6.180.0080.02617.25
5.6.170.0010.02217.16
5.6.160.0050.03017.18
5.6.150.0080.01517.25
5.6.140.0060.01817.29
5.6.130.0060.01817.24
5.6.120.0060.02017.35
5.6.110.0040.02117.06
5.6.100.0020.02117.09
5.6.90.0100.01517.13
5.6.80.0080.01217.03
5.6.70.0050.01916.86
5.6.60.0070.01616.98
5.6.50.0030.02116.87
5.6.40.0070.01516.94
5.6.30.0040.01917.00
5.6.20.0040.02116.96
5.6.10.0050.01616.90
5.6.00.0050.01416.92
5.5.380.0060.01915.77
5.5.370.0050.02615.88
5.5.360.0090.03016.03
5.5.350.0080.02815.81
5.5.340.0090.02816.12
5.5.330.0040.02416.03
5.5.320.0050.01816.03
5.5.310.0070.01616.21
5.5.300.0040.02116.06
5.5.290.0080.01716.08
5.5.280.0080.01916.00
5.5.270.0070.01916.07
5.5.260.0060.02415.93
5.5.250.0040.01615.94
5.5.240.0060.01615.77
5.5.230.0070.01615.83
5.5.220.0060.01515.72
5.5.210.0080.01415.85
5.5.200.0030.01815.79
5.5.190.0080.01415.89
5.5.180.0070.01615.92
5.5.170.0040.00513.67
5.5.160.0030.01815.90
5.5.150.0030.01715.66
5.5.140.0030.01615.72
5.5.130.0040.01615.70
5.5.120.0060.02015.76
5.5.110.0020.02515.93
5.5.100.0080.01915.72
5.5.90.0050.02015.80
5.5.80.0030.01615.71
5.5.70.0060.01615.73
5.5.60.0070.01515.76
5.5.50.0050.01715.74
5.5.40.0040.01815.75
5.5.30.0090.02615.67
5.5.20.0040.02915.73
5.5.10.0070.01915.78
5.5.00.0040.02115.70
5.4.450.0090.01114.43
5.4.440.0050.02014.47
5.4.430.0060.02314.49
5.4.420.0040.02514.60
5.4.410.0040.01714.39
5.4.400.0050.01714.43
5.4.390.0040.01314.36
5.4.380.0040.01814.29
5.4.370.0060.01614.55
5.4.360.0030.01614.51
5.4.350.0060.01414.26
5.4.340.0040.01614.34
5.4.330.0050.00511.95
5.4.320.0060.01414.35
5.4.310.0010.01814.39
5.4.300.0030.01714.27
5.4.290.0020.01714.38
5.4.280.0060.01714.41
5.4.270.0110.02114.40
5.4.260.0020.01714.29
5.4.250.0050.01314.31
5.4.240.0010.01914.35
5.4.230.0060.02114.25
5.4.220.0040.01514.31
5.4.210.0030.03014.29
5.4.200.0050.02914.36
5.4.190.0060.02114.34
5.4.180.0070.02614.43
5.4.170.0060.02914.37
5.4.160.0060.01914.36
5.4.150.0070.02914.30
5.4.140.0050.02913.46
5.4.130.0070.02013.31
5.4.120.0040.02613.45
5.4.110.0060.02613.39
5.4.100.0080.01613.56
5.4.90.0030.02413.36
5.4.80.0020.01513.54
5.4.70.0050.01813.53
5.4.60.0040.01713.54
5.4.50.0030.02613.42
5.4.40.0040.01513.53
5.4.30.0060.01913.51
5.4.20.0080.02113.41
5.4.10.0050.02313.49
5.4.00.0030.01713.33
5.3.290.0000.02112.82
5.3.280.0060.03312.79
5.3.270.0100.01912.82
5.3.260.0050.03612.76
5.3.250.0050.03212.77
5.3.240.0020.03812.79
5.3.230.0060.03712.74
5.3.220.0030.02712.71
5.3.210.0000.02912.70
5.3.200.0090.03712.71
5.3.190.0050.02012.81
5.3.180.0050.03212.78
5.3.170.0020.02812.72
5.3.160.0000.02512.77
5.3.150.0030.02112.77
5.3.140.0070.03012.74
5.3.130.0090.02512.79
5.3.120.0050.02912.76
5.3.110.0000.04512.78
5.3.100.0060.01812.46
5.3.90.0030.03812.53
5.3.80.0050.02912.48
5.3.70.0050.03312.49
5.3.60.0030.04212.40
5.3.50.0030.02112.42
5.3.40.0030.04412.42
5.3.30.0000.03312.42
5.3.20.0020.03712.33
5.3.10.0030.02512.34
5.3.00.0030.03512.31
5.2.170.0010.02811.09
5.2.160.0040.01511.05
5.2.150.0080.02610.96
5.2.140.0040.02111.04
5.2.130.0050.02011.01
5.2.120.0030.01810.94
5.2.110.0030.01511.01
5.2.100.0080.02811.07
5.2.90.0050.02311.08
5.2.80.0050.01610.96
5.2.70.0030.03510.95
5.2.60.0070.03211.05
5.2.50.0040.02510.91
5.2.40.0030.02011.01
5.2.30.0060.03010.96
5.2.20.0040.03010.95
5.2.10.0050.01710.84
5.2.00.0000.03110.75
5.1.60.0050.02210.39
5.1.50.0030.02810.49
5.1.40.0060.01710.48
5.1.30.0000.03310.58
5.1.20.0050.02510.63
5.1.10.0020.02810.52
5.1.00.0050.02210.48
5.0.50.0000.0269.77
5.0.40.0020.0109.70
5.0.30.0030.0319.66
5.0.20.0020.0109.66
5.0.10.0000.0189.66
5.0.00.0000.0249.66
4.4.90.0030.0159.66
4.4.80.0010.0119.66
4.4.70.0000.0159.66
4.4.60.0020.0189.66
4.4.50.0010.0119.66
4.4.40.0000.0279.66
4.4.30.0020.0209.66
4.4.20.0030.0189.66
4.4.10.0060.0109.66
4.4.00.0010.0209.66
4.3.110.0040.0189.66
4.3.100.0000.0179.66
4.3.90.0040.0179.66
4.3.80.0000.0149.66
4.3.70.0000.0199.66
4.3.60.0050.0159.66
4.3.50.0010.0219.66
4.3.40.0000.0309.66
4.3.30.0020.0199.66
4.3.20.0030.0129.66
4.3.10.0020.0179.66
4.3.00.0000.0229.66

preferences:
52.02 ms | 401 KiB | 5 Q