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); print_r($split_array);die(); 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]) { if (floor($split[1]) == $split[1]) { $split[1] = floor($split[0]) . '.' . $split[1]; } $step = '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.0150.00418.68
8.3.50.0060.01518.05
8.3.40.0100.00718.85
8.3.30.0110.00319.10
8.3.20.0000.00720.34
8.3.10.0000.00823.61
8.3.00.0080.00019.08
8.2.180.0070.01116.63
8.2.170.0070.00722.96
8.2.160.0070.00722.12
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0040.00420.97
8.2.110.0030.00719.23
8.2.100.0070.00417.78
8.2.90.0040.00417.63
8.2.80.0000.00818.84
8.2.70.0030.00517.80
8.2.60.0000.00818.09
8.2.50.0040.00418.10
8.2.40.0000.00819.40
8.2.30.0040.00419.09
8.2.20.0070.00017.82
8.2.10.0040.00417.96
8.2.00.0050.00217.83
8.1.280.0100.01025.92
8.1.270.0000.00818.60
8.1.260.0090.00626.35
8.1.250.0070.00028.09
8.1.240.0060.00323.99
8.1.230.0040.00720.97
8.1.220.0000.00817.74
8.1.210.0050.00318.77
8.1.200.0100.00017.22
8.1.190.0040.00417.22
8.1.180.0080.00018.88
8.1.170.0040.00418.58
8.1.160.0040.00419.09
8.1.150.0050.00218.91
8.1.140.0000.00817.29
8.1.130.0090.00017.77
8.1.120.0050.00317.45
8.1.110.0030.00717.46
8.1.100.0000.00817.25
8.1.90.0050.00317.47
8.1.80.0000.00817.50
8.1.70.0050.00217.44
8.1.60.0030.00617.54
8.1.50.0040.00417.54
8.1.40.0050.00317.50
8.1.30.0040.00417.67
8.1.20.0000.00817.54
8.1.10.0040.00417.53
8.1.00.0040.00417.48
8.0.300.0040.00418.77
8.0.290.0030.00516.75
8.0.280.0030.00518.37
8.0.270.0050.00217.09
8.0.260.0060.00017.22
8.0.250.0070.00016.87
8.0.240.0000.00816.88
8.0.230.0050.00316.91
8.0.220.0070.00016.78
8.0.210.0050.00216.96
8.0.200.0030.00316.96
8.0.190.0050.00316.95
8.0.180.0070.00416.94
8.0.170.0000.00716.95
8.0.160.0040.00416.84
8.0.150.0040.00416.85
8.0.140.0000.00816.79
8.0.130.0110.00013.39
8.0.120.0040.00416.77
8.0.110.0000.00816.89
8.0.100.0040.00416.89
8.0.90.0000.00717.04
8.0.80.0040.01516.88
8.0.70.0000.00716.86
8.0.60.0030.00516.82
8.0.50.0000.00716.81
8.0.30.0120.01017.04
8.0.20.0100.01317.40
8.0.10.0040.00416.92
8.0.00.0000.01716.84
7.4.330.0050.00015.15
7.4.320.0030.00316.54
7.4.300.0060.00016.68
7.4.290.0030.00516.52
7.4.280.0050.00316.61
7.4.270.0040.00416.51
7.4.260.0000.01016.50
7.4.250.0040.00416.50
7.4.240.0050.00316.60
7.4.230.0030.00316.44
7.4.220.0120.01516.60
7.4.210.0030.01316.54
7.4.200.0030.00316.70
7.4.160.0080.00816.52
7.4.150.0150.00917.40
7.4.140.0120.00817.86
7.4.130.0090.00916.54
7.4.120.0070.01216.49
7.4.110.0150.00616.44
7.4.100.0100.00716.52
7.4.90.0070.01016.34
7.4.80.0090.01319.39
7.4.70.0060.01216.49
7.4.60.0070.01016.55
7.4.50.0000.00616.69
7.4.40.0080.00816.53
7.4.30.0100.00716.52
7.4.00.0050.01015.10
7.3.330.0020.00213.39
7.3.320.0050.00013.15
7.3.310.0000.00716.29
7.3.300.0070.00016.23
7.3.290.0070.00816.34
7.3.280.0080.01116.32
7.3.270.0120.00617.40
7.3.260.0070.01016.27
7.3.250.0130.00516.30
7.3.240.0130.01016.66
7.3.230.0100.00616.48
7.3.210.0060.01516.38
7.3.200.0120.00619.39
7.3.190.0090.00816.22
7.3.180.0100.00716.27
7.3.170.0080.00816.70
7.3.160.0190.00016.37
7.3.120.0070.01414.62
7.3.110.0090.00614.88
7.3.100.0060.00914.55
7.3.90.0100.00315.02
7.3.80.0030.01014.84
7.3.70.0070.00714.48
7.3.60.0000.01214.85
7.3.50.0130.00014.45
7.3.40.0060.00614.67
7.3.30.0060.00614.65
7.3.20.0000.01516.50
7.3.10.0070.00316.63
7.3.00.0060.00316.79
7.2.330.0080.01216.65
7.2.320.0060.01216.75
7.2.310.0130.00616.37
7.2.300.0090.00916.70
7.2.290.0060.01116.46
7.2.250.0070.01114.94
7.2.240.0060.01015.09
7.2.230.0090.00615.23
7.2.220.0090.00614.94
7.2.210.0000.00914.86
7.2.200.0070.00714.75
7.2.190.0120.00315.00
7.2.180.0060.01014.95
7.2.170.0040.01414.86
7.2.00.0080.00418.57
7.1.330.0100.00315.87
7.1.320.0040.01215.89
7.1.310.0070.00715.87
7.1.300.0040.00815.68
7.1.290.0040.01115.63
7.1.280.0030.00915.36
7.1.270.0060.00615.69
7.1.260.0000.01315.62
7.1.100.0590.00715.23
7.1.70.0000.00717.00
7.1.60.0070.01719.22
7.1.50.0030.01716.80
7.1.00.0070.07022.36
7.0.200.0040.00416.91
7.0.140.0130.05022.04
7.0.60.0030.04019.96
7.0.50.0030.04017.89
7.0.40.0030.08320.04
7.0.30.0230.05020.20
7.0.20.0270.06720.19
7.0.10.0070.04020.23
7.0.00.0100.05020.23
5.6.280.0070.07021.12
5.6.210.0070.04020.61
5.6.200.0100.07018.14
5.6.190.0130.03720.68
5.6.180.0300.05720.63
5.6.170.0230.06720.50
5.6.160.0030.04320.54
5.6.150.0070.05718.14
5.6.140.0000.09018.17
5.6.130.0100.05718.21
5.6.120.0000.06021.02
5.6.110.0030.04721.03
5.6.100.0130.07320.99
5.6.90.0070.07720.98
5.6.80.0030.04020.39
5.5.350.0230.07320.35
5.5.340.0170.07317.93
5.5.330.0100.05020.39
5.5.320.0500.07020.41
5.5.310.0200.04020.51
5.5.300.0130.07017.93
5.5.290.0030.08318.01
5.5.280.0070.04020.66
5.5.270.0030.04320.88
5.5.260.0170.06020.86
5.5.250.0100.06020.60
5.5.240.0030.07720.30
5.4.450.0800.04719.19
5.4.440.0930.05319.23
5.4.430.0800.05719.42
5.4.420.0070.06319.39
5.4.410.1070.06719.48
5.4.400.0670.05719.15
5.4.390.0170.05318.75
5.4.380.0130.05718.75
5.4.370.0130.05718.75
5.4.360.0070.06018.70
5.4.350.0130.05718.50
5.4.340.0130.05718.75
5.4.320.0170.05318.71
5.4.310.0200.04718.58
5.4.300.0230.04718.54
5.4.290.0130.05318.54
5.4.280.0170.05318.77
5.4.270.0130.05718.73
5.4.260.0170.05318.73
5.4.250.0200.05018.71
5.4.240.0170.05718.57
5.4.230.0230.04318.60
5.4.220.0200.05318.71
5.4.210.0170.05318.61
5.4.200.0170.05016.75
5.4.190.0200.05018.73
5.4.180.0070.06318.82
5.4.170.0100.07018.70
5.4.160.0270.04018.46
5.4.150.0170.05318.73
5.4.140.0170.05016.23
5.4.130.0170.05016.31
5.4.120.0270.03716.23
5.4.110.0170.04716.34
5.4.100.0200.05316.34
5.4.90.0130.05716.20
5.4.80.0170.05016.32
5.4.70.0100.05716.44
5.4.60.0170.04716.28
5.4.50.0170.04316.27
5.4.40.0070.06016.27
5.4.30.0300.03716.23
5.4.20.0270.04016.26
5.4.10.0200.04716.20
5.4.00.0200.04715.67
5.3.290.0170.05314.89
5.3.280.0130.06014.59
5.3.270.0300.04314.67
5.3.260.0170.05314.72
5.3.250.0100.05714.80
5.3.240.0170.05014.66
5.3.230.0100.06014.82
5.3.220.0200.04714.70
5.3.210.0200.05014.69
5.3.200.0200.04714.64
5.3.190.0130.05714.62
5.3.180.0130.06014.60
5.3.170.0130.05714.61
5.3.160.0200.04714.79
5.3.150.0170.05014.61
5.3.140.0330.03714.71
5.3.130.0200.07014.55
5.3.120.0230.05014.55
5.3.110.0130.06014.74
5.3.100.0230.04714.08
5.3.90.0170.05014.21
5.3.80.0170.05014.06
5.3.70.0200.04714.26
5.3.60.0100.05714.14
5.3.50.0170.05014.00
5.3.40.0200.04714.04
5.3.30.0130.05313.93
5.3.20.0100.05713.75
5.3.10.0030.06013.69
5.3.00.0230.06313.64
5.2.170.0170.04011.27
5.2.160.0270.03011.22
5.2.150.0100.04311.22
5.2.140.0130.06011.16
5.2.130.0070.04711.27
5.2.120.0200.03011.34
5.2.110.0230.03711.32
5.2.100.0100.04311.16
5.2.90.0170.04311.17
5.2.80.0100.04311.32
5.2.70.0130.04311.13
5.2.60.0130.04011.05
5.2.50.0130.04011.14
5.2.40.0170.03711.12
5.2.30.0130.04011.07
5.2.20.0130.04011.00
5.2.10.0100.04010.92
5.2.00.0130.03710.68
5.1.60.0100.03310.14
5.1.50.0100.03310.14
5.1.40.0100.03710.14
5.1.30.0200.03710.37
5.1.20.0170.04310.48
5.1.10.0130.04310.29
5.1.00.0170.04010.07
5.0.50.0130.0278.77
5.0.40.0070.0378.46
5.0.30.0100.0508.29
5.0.20.0100.0308.26
5.0.10.0070.0378.33
5.0.00.0100.0408.39
4.4.90.0030.0305.96
4.4.80.0170.0136.02
4.4.70.0030.0235.95
4.4.60.0000.0306.04
4.4.50.0070.0205.97
4.4.40.0100.0335.91
4.4.30.0070.0275.96
4.4.20.0030.0235.96
4.4.10.0030.0236.01
4.4.00.0070.0335.94
4.3.110.0030.0235.94
4.3.100.0000.0275.88
4.3.90.0070.0235.91
4.3.80.0000.0375.90
4.3.70.0100.0175.94
4.3.60.0100.0175.84
4.3.50.0030.0235.83
4.3.40.0130.0235.79
4.3.30.0070.0204.62
4.3.20.0030.0234.62
4.3.10.0000.0304.62
4.3.00.0000.0237.23

preferences:
70.01 ms | 400 KiB | 5 Q