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; } if (floor($split[0]) != $split[0]) { $return_array[] = $split[0]; $return_array[] = floor($split[0]) + 1; } if (floor($split[1]) != $split[1]) { $return_array[] = $split[1]; $return_array[] = floor($split[1]) + 1; } foreach (range($split[0], $split[1], 1) 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'));

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.00318.68
8.3.50.0140.00821.99
8.3.40.0070.00718.93
8.3.30.0130.00319.34
8.3.20.0080.00020.34
8.3.10.0050.00323.68
8.3.00.0060.00319.17
8.2.180.0110.00716.75
8.2.170.0110.00322.96
8.2.160.0100.00322.20
8.2.150.0050.00324.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0000.00821.17
8.2.110.0030.00622.08
8.2.100.0120.00017.84
8.2.90.0030.00617.75
8.2.80.0080.00018.91
8.2.70.0000.00818.05
8.2.60.0030.00618.15
8.2.50.0090.00018.10
8.2.40.0070.00019.46
8.2.30.0020.00519.51
8.2.20.0020.00517.84
8.2.10.0040.00418.09
8.2.00.0000.00717.96
8.1.280.0100.00725.92
8.1.270.0030.01319.04
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0000.00924.09
8.1.230.0070.00421.02
8.1.220.0000.00817.79
8.1.210.0000.00818.77
8.1.200.0060.00317.35
8.1.190.0040.00417.23
8.1.180.0040.00419.07
8.1.170.0050.00318.71
8.1.160.0050.00218.98
8.1.150.0000.00718.98
8.1.140.0060.00317.54
8.1.130.0050.00217.91
8.1.120.0030.00317.48
8.1.110.0070.00417.44
8.1.100.0000.00717.45
8.1.90.0000.00717.50
8.1.80.0040.00417.40
8.1.70.0000.00717.58
8.1.60.0050.00317.70
8.1.50.0050.00317.55
8.1.40.0030.00617.62
8.1.30.0040.00417.63
8.1.20.0040.00417.79
8.1.10.0050.00317.57
8.1.00.0040.00717.48
8.0.300.0040.00418.77
8.0.290.0000.00816.88
8.0.280.0000.00718.52
8.0.270.0000.00717.27
8.0.260.0040.00417.36
8.0.250.0070.00016.92
8.0.240.0000.00716.95
8.0.230.0000.00717.02
8.0.220.0000.00816.96
8.0.210.0070.00016.94
8.0.200.0000.00817.03
8.0.190.0000.00816.93
8.0.180.0030.00716.90
8.0.170.0070.00017.03
8.0.160.0030.00317.01
8.0.150.0000.00716.91
8.0.140.0040.00416.98
8.0.130.0000.01113.45
8.0.120.0000.00916.87
8.0.110.0050.00317.04
8.0.100.0000.00717.02
8.0.90.0070.00016.86
8.0.80.0160.00616.98
8.0.70.0000.00816.83
8.0.60.0040.00417.02
8.0.50.0070.00017.01
8.0.30.0090.01217.04
8.0.20.0130.00817.40
8.0.10.0000.00717.17
8.0.00.0100.00816.62
7.4.330.0000.00515.25
7.4.320.0060.00016.53
7.4.300.0000.00716.73
7.4.290.0080.00016.57
7.4.280.0000.00716.68
7.4.270.0000.00816.69
7.4.260.0050.00316.62
7.4.250.0060.00316.48
7.4.240.0020.00516.62
7.4.230.0030.00316.47
7.4.220.0090.01016.75
7.4.210.0100.01016.55
7.4.200.0000.00816.43
7.4.160.0070.00716.63
7.4.150.0120.01217.40
7.4.140.0110.00717.86
7.4.130.0150.00516.62
7.4.120.0090.00916.62
7.4.110.0120.01416.59
7.4.100.0040.01716.49
7.4.90.0110.00716.59
7.4.80.0130.00619.39
7.4.70.0090.00916.56
7.4.60.0100.00616.73
7.4.50.0030.00516.48
7.4.40.0090.00816.38
7.4.30.0120.00416.48
7.4.00.0070.01014.99
7.3.330.0050.00013.37
7.3.320.0050.00013.28
7.3.310.0030.00316.27
7.3.300.0030.00316.50
7.3.290.0030.01416.43
7.3.280.0090.00616.40
7.3.270.0030.02017.40
7.3.260.0030.01416.40
7.3.250.0070.01016.47
7.3.240.0060.01616.39
7.3.230.0080.01416.65
7.3.210.0120.01616.48
7.3.200.0100.00719.39
7.3.190.0110.00416.59
7.3.180.0120.00316.43
7.3.170.0120.00616.56
7.3.160.0100.00616.76
7.3.120.0110.00414.76
7.3.110.0110.00714.79
7.3.100.0100.00314.74
7.3.90.0060.00315.08
7.3.80.0040.00414.77
7.3.70.0100.00314.89
7.3.60.0100.00714.96
7.3.50.0030.00614.90
7.3.40.0050.00514.73
7.3.30.0040.00814.86
7.3.20.0090.00616.67
7.3.10.0060.00616.51
7.3.00.0000.01216.74
7.2.330.0120.00616.86
7.2.320.0030.01316.64
7.2.310.0100.00716.85
7.2.300.0100.01016.81
7.2.290.0030.01316.92
7.2.250.0030.01615.03
7.2.240.0040.01115.09
7.2.230.0000.01515.07
7.2.220.0000.00915.09
7.2.210.0080.00615.30
7.2.200.0070.00714.80
7.2.190.0060.00314.97
7.2.180.0040.00815.17
7.2.170.0100.00715.07
7.2.00.0000.01419.60
7.1.330.0060.00615.95
7.1.320.0000.01315.74
7.1.310.0040.01215.81
7.1.300.0030.01015.66
7.1.290.0060.00315.88
7.1.280.0080.00415.68
7.1.270.0030.01315.59
7.1.260.0040.00815.76
7.1.100.0770.00615.54
7.1.70.0000.00816.97
7.1.60.0150.00919.22
7.1.50.0100.00716.85
7.1.00.0070.07322.35
7.0.200.0000.00816.85
7.0.140.0030.06321.99
7.0.60.0030.04319.88
7.0.50.0030.07017.88
7.0.40.0030.04720.18
7.0.30.0270.06020.23
7.0.20.0100.04720.06
7.0.10.0000.04720.30
7.0.00.0100.08320.05
5.6.280.0070.07321.00
5.6.210.0130.06020.58
5.6.200.0000.09318.15
5.6.190.0030.05720.41
5.6.180.3230.04320.61
5.6.170.0330.07020.71
5.6.160.0030.08320.61
5.6.150.0000.04318.17
5.6.140.0070.08318.18
5.6.130.0030.04018.21
5.6.120.0030.08320.88
5.6.110.0030.06321.00
5.6.100.0070.08721.15
5.6.90.0030.06321.15
5.6.80.0130.04720.55
5.6.70.3630.03720.39
5.5.350.0370.07020.54
5.5.340.0030.08318.07
5.5.330.0170.07320.21
5.5.320.3200.04720.38
5.5.310.0230.06720.34
5.5.300.0030.04018.09
5.5.290.0030.04018.02
5.5.280.0070.06720.70
5.5.270.0070.04320.95
5.5.260.0100.07020.76
5.5.250.0100.06720.55
5.5.240.0200.07720.05
5.4.450.0170.05019.39
5.4.440.0700.05719.53
5.4.430.0800.04719.30
5.4.420.0730.05719.59
5.4.410.0870.05719.44
5.4.400.0770.04719.07
5.4.390.0130.05718.80
5.4.380.0130.06018.80
5.4.370.0270.04318.61
5.4.360.0230.04718.47
5.4.350.0200.06718.80
5.4.340.0170.06018.71
5.4.320.0100.06718.75
5.4.310.0100.06018.78
5.4.300.0200.05318.61
5.4.290.0370.04318.48
5.4.280.0170.05718.75
5.4.270.0070.06718.69
5.4.260.0200.05018.57
5.4.250.0100.06718.57
5.4.240.0170.06018.76
5.4.230.0170.07018.73
5.4.220.0270.04718.78
5.4.210.0170.05018.77
5.4.200.0170.05316.54
5.4.190.0230.04718.73
5.4.180.0170.05718.76
5.4.170.0200.07718.71
5.4.160.0270.04318.68
5.4.150.0170.05718.67
5.4.140.0200.05016.47
5.4.130.0170.05016.37
5.4.120.0170.05316.36
5.4.110.0300.04016.22
5.4.100.0170.05716.34
5.4.90.0200.05016.38
5.4.80.0200.05016.21
5.4.70.0200.06716.41
5.4.60.0170.05016.27
5.4.50.0100.05316.24
5.4.40.0170.05316.28
5.4.30.0270.04016.32
5.4.20.0330.07016.14
5.4.10.0300.04716.29
5.4.00.0130.05315.65
5.3.290.0230.05014.71
5.3.280.0170.05314.64
5.3.270.0200.07014.77
5.3.260.0200.07314.80
5.3.250.0200.05314.75
5.3.240.0170.05314.62
5.3.230.0130.05714.59
5.3.220.0200.04714.69
5.3.210.0270.06014.75
5.3.200.0170.06014.71
5.3.190.0200.05714.60
5.3.180.0070.06314.56
5.3.170.0200.05014.62
5.3.160.0230.04714.56
5.3.150.0200.04714.63
5.3.140.0170.05314.68
5.3.130.0100.06014.54
5.3.120.0170.05714.58
5.3.110.0170.06014.66
5.3.100.0300.05014.05
5.3.90.0200.07014.10
5.3.80.0170.05014.20
5.3.70.0170.05014.09
5.3.60.0100.06014.19
5.3.50.0200.05014.14
5.3.40.0200.04714.19
5.3.30.0200.05714.03
5.3.20.0130.05313.75
5.3.10.0270.05713.71
5.3.00.0230.04713.71
5.2.170.0030.05311.18
5.2.160.0170.03711.38
5.2.150.0200.05311.29
5.2.140.0230.04711.27
5.2.130.0100.04311.23
5.2.120.0130.04011.17
5.2.110.0070.05311.23
5.2.100.0100.04311.18
5.2.90.0170.04311.15
5.2.80.0230.03311.14
5.2.70.0170.04011.34
5.2.60.0100.04711.13
5.2.50.0170.04011.11
5.2.40.0100.04311.00
5.2.30.0200.03711.04
5.2.20.0200.04310.98
5.2.10.0200.04310.92
5.2.00.0100.05710.85
5.1.60.0070.04010.13
5.1.50.0130.04010.00
5.1.40.0130.04310.13
5.1.30.0130.04710.35
5.1.20.0170.04310.55
5.1.10.0170.04010.27
5.1.00.0230.03710.22
5.0.50.0070.0338.66
5.0.40.0070.0308.64
5.0.30.0100.0438.45
5.0.20.0100.0308.35
5.0.10.0070.0378.33
5.0.00.0070.0438.39
4.4.90.0130.0176.05
4.4.80.0070.0276.04
4.4.70.0100.0275.93
4.4.60.0100.0276.02
4.4.50.0100.0275.93
4.4.40.0030.0476.04
4.4.30.0070.0306.02
4.4.20.0100.0276.01
4.4.10.0000.0375.97
4.4.00.0100.0435.97
4.3.110.0170.0205.87
4.3.100.0030.0235.83
4.3.90.0170.0205.85
4.3.80.0070.0435.83
4.3.70.0070.0305.85
4.3.60.0030.0335.81
4.3.50.0100.0275.87
4.3.40.0030.0375.87
4.3.30.0070.0204.77
4.3.20.0000.0274.77
4.3.10.0070.0174.77
4.3.00.0170.0207.30

preferences:
44.45 ms | 401 KiB | 5 Q