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; echo $step; if (floor($split[0]) != $split[0]) { $return_array[] = $split[0]; $split[0] = floor($split[0]) + 1; } echo $step; if (floor($split[1]) != $split[1]) { $return_array[] = $split[1]; $split[1] = floor($split[1]); } if ($split[0] < $split[1]) { 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.60.0040.01118.18
8.3.50.0070.01221.94
8.3.40.0160.00619.09
8.3.30.0170.00019.17
8.3.20.0080.00020.29
8.3.10.0040.00423.69
8.3.00.0040.00419.14
8.2.180.0150.00416.63
8.2.170.0090.00622.96
8.2.160.0070.00722.25
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00421.19
8.2.110.0000.01121.03
8.2.100.0060.00617.84
8.2.90.0080.00017.75
8.2.80.0080.00018.91
8.2.70.0030.00618.05
8.2.60.0000.00818.34
8.2.50.0040.00418.10
8.2.40.0040.00419.35
8.2.30.0000.00719.43
8.2.20.0030.00517.88
8.2.10.0030.00518.16
8.2.00.0040.00417.93
8.1.280.0140.00425.92
8.1.270.0040.00424.66
8.1.260.0030.00626.35
8.1.250.0000.00728.09
8.1.240.0090.00023.88
8.1.230.0080.00421.00
8.1.220.0030.00517.91
8.1.210.0040.00418.77
8.1.200.0000.00817.48
8.1.190.0060.00317.23
8.1.180.0000.00919.16
8.1.170.0080.00018.60
8.1.160.0070.00019.17
8.1.150.0000.00718.91
8.1.140.0040.00417.48
8.1.130.0030.00317.95
8.1.120.0040.00417.59
8.1.110.0060.00317.56
8.1.100.0000.00717.56
8.1.90.0000.00717.64
8.1.80.0070.00017.49
8.1.70.0040.00417.48
8.1.60.0000.00917.69
8.1.50.0040.00417.54
8.1.40.0030.00517.67
8.1.30.0080.00017.68
8.1.20.0030.00517.74
8.1.10.0000.00917.60
8.1.00.0030.00717.65
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0000.00818.55
8.0.270.0040.00417.29
8.0.260.0000.00717.35
8.0.250.0000.00717.02
8.0.240.0000.00617.05
8.0.230.0040.00417.04
8.0.220.0030.00317.01
8.0.210.0030.00316.97
8.0.200.0070.00417.07
8.0.190.0000.00817.07
8.0.180.0030.00717.02
8.0.170.0040.00417.04
8.0.160.0000.00716.98
8.0.150.0040.00416.95
8.0.140.0040.00416.87
8.0.130.0060.00013.44
8.0.120.0080.00016.80
8.0.110.0070.00016.95
8.0.100.0050.00217.07
8.0.90.0000.00716.85
8.0.80.0090.01316.90
8.0.70.0000.00716.80
8.0.60.0050.00316.92
8.0.50.0060.00316.89
8.0.30.0090.01417.08
8.0.20.0140.01117.40
8.0.10.0040.00417.12
8.0.00.0060.01117.00
7.4.330.0020.00215.26
7.4.320.0030.00316.75
7.4.300.0030.00316.57
7.4.290.0030.00316.74
7.4.280.0000.00716.59
7.4.270.0040.00416.55
7.4.260.0070.00016.67
7.4.250.0000.00716.51
7.4.240.0050.00416.63
7.4.230.0070.00016.62
7.4.220.0100.01016.66
7.4.210.0070.01316.56
7.4.200.0040.00416.77
7.4.160.0070.00716.69
7.4.150.0120.01317.40
7.4.140.0120.00717.86
7.4.130.0080.01016.73
7.4.120.0120.00516.68
7.4.110.0150.00416.74
7.4.100.0090.01216.52
7.4.90.0080.00816.62
7.4.80.0110.01019.39
7.4.70.0100.00716.79
7.4.60.0030.01216.75
7.4.50.0040.00416.67
7.4.40.0080.00816.66
7.4.30.0120.00416.73
7.4.10.0070.01114.71
7.4.00.0110.00715.02
7.3.330.0000.00613.31
7.3.320.0000.00513.41
7.3.310.0030.00316.35
7.3.300.0060.00016.45
7.3.290.0070.00816.45
7.3.280.0070.01216.46
7.3.270.0000.01917.40
7.3.260.0040.01216.50
7.3.250.0100.01016.71
7.3.240.0130.00916.40
7.3.230.0090.00616.68
7.3.210.0070.01516.36
7.3.200.0070.01419.39
7.3.190.0060.00916.75
7.3.180.0090.00916.46
7.3.170.0050.01116.65
7.3.160.0070.01016.56
7.3.130.0030.01615.14
7.3.120.0060.01014.81
7.3.110.0080.00814.97
7.3.100.0060.00914.55
7.3.90.0140.00414.98
7.3.80.0060.00314.96
7.3.70.0070.01014.95
7.3.60.0080.00814.81
7.3.50.0070.00715.05
7.3.40.0100.00314.59
7.3.30.0070.01014.88
7.3.20.0000.00916.46
7.3.10.0040.01216.70
7.3.00.0030.01216.50
7.2.330.0040.01416.95
7.2.320.0150.00316.74
7.2.310.0100.01316.74
7.2.300.0150.00416.54
7.2.290.0030.01716.62
7.2.260.0100.01015.08
7.2.250.0100.01015.24
7.2.240.0060.00915.10
7.2.230.0130.00314.99
7.2.220.0070.01315.09
7.2.210.0000.01115.13
7.2.200.0040.01114.92
7.2.190.0060.00614.90
7.2.180.0070.01015.16
7.2.170.0090.00315.19
7.2.160.0040.01515.05
7.2.150.0070.00716.98
7.2.140.0030.01216.77
7.2.130.0100.00716.95
7.2.120.0090.00317.12
7.2.110.0120.00316.73
7.2.100.0070.00316.88
7.2.90.0060.00617.05
7.2.80.0060.00616.65
7.2.70.0040.00416.73
7.2.60.0070.00317.03
7.2.50.0000.01716.79
7.2.40.0110.00416.91
7.2.30.0090.00617.13
7.2.20.0080.00616.94
7.2.10.0060.00917.05
7.2.00.0000.01416.80
7.1.330.0000.01415.97
7.1.320.0100.00715.78
7.1.310.0060.00616.13
7.1.300.0070.01015.60
7.1.290.0030.01015.69
7.1.280.0040.01115.86
7.1.270.0000.01515.67
7.1.260.0090.00315.77
7.1.250.0100.00315.84
7.1.240.0000.01415.77
7.1.230.0040.01115.77
7.1.220.0100.00315.64
7.1.210.0030.01015.97
7.1.200.0070.00715.89
7.1.190.0000.00915.93
7.1.180.0030.01315.84
7.1.170.0030.01015.77
7.1.160.0000.01015.63
7.1.150.0000.01015.74
7.1.140.0070.00715.84
7.1.130.0040.01115.51
7.1.120.0000.01315.93
7.1.110.0000.00915.78
7.1.100.0440.00515.91
7.1.90.0070.00315.86
7.1.80.0100.00015.93
7.1.70.0020.00916.41
7.1.60.0080.01317.46
7.1.50.0080.01216.38
7.1.40.0040.00815.74
7.1.30.0000.01415.51
7.1.20.0070.00315.74
7.1.10.0050.01015.78
7.1.00.0100.03819.08
7.0.330.0090.00315.14
7.0.320.0030.00915.30
7.0.310.0030.00615.36
7.0.300.0090.00315.43
7.0.290.0040.00915.08
7.0.280.0040.01115.61
7.0.270.0060.00315.41
7.0.260.0030.01015.36
7.0.250.0120.00015.48
7.0.240.0060.00815.56
7.0.230.0070.00415.62
7.0.220.0000.01615.22
7.0.210.0040.01115.33
7.0.200.0060.00416.07
7.0.190.0030.00615.25
7.0.180.0030.01015.41
7.0.170.0000.01315.09
7.0.160.0060.00315.34
7.0.150.0040.00815.22
7.0.140.0050.02218.76
7.0.130.0030.01315.24
7.0.120.0040.00415.58
7.0.110.0040.00715.23
7.0.100.0100.00515.37
7.0.90.0030.01215.46
7.0.80.0090.00615.60
7.0.70.0030.00715.38
7.0.60.0050.02617.55
7.0.50.0110.03716.64
7.0.40.0060.02416.72
7.0.30.0230.02416.95
7.0.20.0200.03816.87
7.0.10.0030.05016.86
7.0.00.0030.04716.79
5.6.400.0120.00314.45
5.6.390.0060.00314.23
5.6.380.0000.01114.58
5.6.370.0090.00614.64
5.6.360.0000.00914.46
5.6.350.0070.00714.69
5.6.340.0000.01414.24
5.6.330.0110.00414.72
5.6.320.0030.01214.60
5.6.310.0090.00614.74
5.6.300.0100.00314.79
5.6.290.0060.00914.47
5.6.280.0060.03817.71
5.6.270.0030.00714.41
5.6.260.0060.01114.55
5.6.250.0110.00514.25
5.6.240.0060.01314.42
5.6.230.0070.00714.46
5.6.220.0040.00814.52
5.6.210.0150.03317.51
5.6.200.0100.04216.24
5.6.190.0080.04517.62
5.6.180.2050.02517.63
5.6.170.0150.02617.44
5.6.160.0070.02517.56
5.6.150.0030.04916.30
5.6.140.0070.04416.33
5.6.130.0060.03816.42
5.6.120.0020.04917.76
5.6.110.0080.04417.86
5.6.100.0050.03017.61
5.6.90.0060.03217.64
5.6.80.0060.04317.38
5.6.70.0150.04117.38
5.6.60.0040.01214.28
5.6.50.0060.00914.12
5.6.40.0070.00714.46
5.6.30.0030.00614.45
5.6.20.0100.00714.27
5.6.10.0030.01414.30
5.6.00.0080.00414.37
5.5.380.0030.01114.37
5.5.370.0100.00614.17
5.5.360.0070.00714.11
5.5.350.0030.04817.44
5.5.340.0090.03816.14
5.5.330.0030.04617.21
5.5.320.0170.04217.42
5.5.310.0130.03817.19
5.5.300.0050.02716.02
5.5.290.0100.03816.12
5.5.280.0030.04217.66
5.5.270.0060.03817.54
5.5.260.0080.04617.58
5.5.250.0050.03717.51
5.5.240.0060.04017.18
5.5.230.0060.00914.43
5.5.220.0030.00814.38
5.5.210.0070.01014.28
5.5.200.0000.00914.28
5.5.190.0060.00914.36
5.5.180.0070.00314.28
5.5.170.0070.01014.48
5.5.160.0070.01014.38
5.5.150.0000.01614.20
5.5.140.0040.01214.00
5.5.130.0030.01014.12
5.5.120.0040.00714.45
5.5.110.0070.00714.31
5.5.100.0030.00814.46
5.5.90.0030.01314.27
5.5.80.0040.01114.27
5.5.70.0100.00614.31
5.5.60.0060.00914.47
5.5.50.0030.00613.99
5.5.40.0040.00714.08
5.5.30.0070.00614.23
5.5.20.0030.00714.17
5.5.10.0040.00814.31
5.5.00.0030.01014.30
5.4.450.0180.03115.18
5.4.440.0420.03015.31
5.4.430.0350.03215.39
5.4.420.0190.03115.21
5.4.410.0350.02515.17
5.4.400.0520.02715.13
5.4.390.0150.03214.95
5.4.380.0100.03414.82
5.4.370.0120.03114.83
5.4.360.0100.02814.97
5.4.350.0150.02814.76
5.4.340.0110.03114.82
5.4.330.0090.00010.74
5.4.320.0110.03114.95
5.4.310.0180.03314.86
5.4.300.0140.02714.96
5.4.290.0100.02914.97
5.4.280.0070.03314.81
5.4.270.0140.02714.88
5.4.260.0120.02914.93
5.4.250.0130.02614.89
5.4.240.0170.02314.69
5.4.230.0070.04314.83
5.4.220.0110.03114.91
5.4.210.0100.03114.79
5.4.200.0100.03013.78
5.4.190.0050.03714.79
5.4.180.0100.04314.80
5.4.170.0110.02914.80
5.4.160.0130.02715.01
5.4.150.0130.02814.95
5.4.140.0120.02813.79
5.4.130.0100.03013.73
5.4.120.0080.03213.68
5.4.110.0100.03013.73
5.4.100.0070.03013.68
5.4.90.0150.02313.88
5.4.80.0050.03313.69
5.4.70.0070.03213.68
5.4.60.0070.03013.78
5.4.50.0070.03213.69
5.4.40.0060.03213.65
5.4.30.0170.03013.40
5.4.20.0030.03413.62
5.4.10.0060.03313.77
5.4.00.0080.03013.47
5.3.290.0200.05314.73
5.3.280.0170.05014.71
5.3.270.0270.06314.64
5.3.260.0100.06014.79
5.3.250.0130.05314.62
5.3.240.0130.05314.68
5.3.230.0100.06014.66
5.3.220.0100.05714.64
5.3.210.0200.05014.63
5.3.200.0100.05714.60
5.3.190.0400.04014.63
5.3.180.0170.05314.75
5.3.170.0200.05014.68
5.3.160.0270.04714.80
5.3.150.0130.05714.61
5.3.140.0230.05714.78
5.3.130.0170.06314.61
5.3.120.0200.05714.70
5.3.110.0070.06314.78
5.3.100.0130.05714.18
5.3.90.0130.05314.20
5.3.80.0200.04314.25
5.3.70.0100.05714.16
5.3.60.0130.07714.12
5.3.50.0270.04014.13
5.3.40.0130.07014.18
5.3.30.0230.04013.95
5.3.20.0070.05713.82
5.3.10.0130.05013.80
5.3.00.0130.05713.78
5.2.170.0070.04711.18
5.2.160.0070.05011.18
5.2.150.0070.04711.21
5.2.140.0230.03011.27
5.2.130.0130.04011.34
5.2.120.0170.03711.24
5.2.110.0170.05011.15
5.2.100.0130.04011.16
5.2.90.0170.04011.18
5.2.80.0230.03311.10
5.2.70.0330.04011.14
5.2.60.0170.04011.09
5.2.50.0130.04011.03
5.2.40.0100.04311.09
5.2.30.0170.03710.97
5.2.20.0200.03711.08
5.2.10.0130.03711.01
5.2.00.0070.04310.76
5.1.60.0030.04010.05
5.1.50.0130.03310.04
5.1.40.0130.03010.00
5.1.30.0070.04010.37
5.1.20.0130.03310.47
5.1.10.0100.03710.11
5.1.00.0100.03710.19
5.0.50.0100.0278.65
5.0.40.0100.0238.55
5.0.30.0130.0438.43
5.0.20.0030.0308.23
5.0.10.0070.0308.24
5.0.00.0100.0408.33
4.4.90.0070.0235.95
4.4.80.0000.0275.91
4.4.70.0100.0176.01
4.4.60.0000.0275.89
4.4.50.0030.0235.93
4.4.40.0070.0336.06
4.4.30.0070.0235.95
4.4.20.0030.0235.96
4.4.10.0070.0206.06
4.4.00.0070.0375.97
4.3.110.0030.0235.85
4.3.100.0070.0205.86
4.3.90.0130.0175.81
4.3.80.0030.0375.93
4.3.70.0030.0235.82
4.3.60.0100.0175.95
4.3.50.0130.0175.84
4.3.40.0070.0435.77
4.3.30.0100.0174.79
4.3.20.0070.0274.79
4.3.10.0030.0274.79
4.3.00.0130.0177.23

preferences:
71.74 ms | 401 KiB | 5 Q