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(floor($split[0]), floor($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.0100.01018.52
8.3.50.0070.01121.86
8.3.40.0060.00918.93
8.3.30.0110.00319.21
8.3.20.0080.00020.46
8.3.10.0000.00823.83
8.3.00.0080.00019.17
8.2.180.0090.00916.72
8.2.170.0070.00722.96
8.2.160.0070.00722.10
8.2.150.0000.00924.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0040.00421.25
8.2.110.0070.00317.63
8.2.100.0080.00417.97
8.2.90.0000.00917.88
8.2.80.0040.00418.73
8.2.70.0040.00418.18
8.2.60.0000.00818.16
8.2.50.0000.00818.10
8.2.40.0060.00319.50
8.2.30.0030.00619.37
8.2.20.0040.00417.71
8.2.10.0080.00018.21
8.2.00.0040.00417.89
8.1.280.0180.00025.92
8.1.270.0040.00418.83
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0130.00323.84
8.1.230.0070.00320.95
8.1.220.0050.00317.91
8.1.210.0030.00518.77
8.1.200.0050.00417.48
8.1.190.0080.00017.35
8.1.180.0080.00018.77
8.1.170.0030.00618.59
8.1.160.0030.00519.14
8.1.150.0060.00318.89
8.1.140.0020.00517.46
8.1.130.0040.00417.98
8.1.120.0080.00017.57
8.1.110.0030.00717.54
8.1.100.0000.00717.43
8.1.90.0030.00517.47
8.1.80.0050.00317.44
8.1.70.0000.00717.55
8.1.60.0030.00517.68
8.1.50.0040.00417.51
8.1.40.0040.00417.56
8.1.30.0040.00417.76
8.1.20.0040.00417.73
8.1.10.0040.00417.63
8.1.00.0070.00017.64
8.0.300.0040.00418.77
8.0.290.0000.00816.88
8.0.280.0030.00318.63
8.0.270.0000.00817.33
8.0.260.0000.00717.34
8.0.250.0070.00016.92
8.0.240.0000.00717.04
8.0.230.0000.00717.04
8.0.220.0030.00517.01
8.0.210.0050.00217.02
8.0.200.0040.00417.03
8.0.190.0090.00017.11
8.0.180.0110.00016.90
8.0.170.0050.00317.01
8.0.160.0000.00716.88
8.0.150.0100.00016.98
8.0.140.0070.00016.83
8.0.130.0000.00613.39
8.0.120.0000.00916.95
8.0.110.0050.00216.97
8.0.100.0050.00216.95
8.0.90.0040.00416.97
8.0.80.0040.01416.93
8.0.70.0020.00517.04
8.0.60.0000.00717.00
8.0.50.0030.00517.00
8.0.30.0060.01317.40
8.0.20.0160.00717.40
8.0.10.0070.00017.05
8.0.00.0090.01216.78
7.4.330.0000.00515.20
7.4.320.0030.00316.59
7.4.300.0000.00616.59
7.4.290.0050.00316.70
7.4.280.0000.00716.60
7.4.270.0030.00316.64
7.4.260.0100.00016.59
7.4.250.0050.00316.66
7.4.240.0040.00416.54
7.4.230.0040.00416.79
7.4.220.0170.00916.64
7.4.210.0170.00316.48
7.4.200.0000.00716.52
7.4.160.0120.00316.63
7.4.150.0090.01517.40
7.4.140.0130.00517.86
7.4.130.0060.01316.61
7.4.120.0110.00716.76
7.4.110.0040.01816.58
7.4.100.0130.01016.55
7.4.90.0110.01116.42
7.4.80.0030.01419.39
7.4.70.0180.00416.62
7.4.60.0130.00316.68
7.4.50.0050.00316.57
7.4.40.0100.00616.68
7.4.30.0030.01316.66
7.4.00.0120.00314.87
7.3.330.0050.00013.23
7.3.320.0000.00513.40
7.3.310.0030.00316.31
7.3.300.0030.00316.43
7.3.290.0040.01116.43
7.3.280.0080.01016.39
7.3.270.0120.00617.40
7.3.260.0070.01016.57
7.3.250.0080.01216.58
7.3.240.0140.00916.57
7.3.230.0160.00616.64
7.3.210.0130.01316.43
7.3.200.0030.01619.39
7.3.190.0030.01216.58
7.3.180.0060.01016.54
7.3.170.0090.00916.64
7.3.160.0090.00616.48
7.3.120.0110.00714.70
7.3.110.0040.01114.98
7.3.100.0000.01314.91
7.3.90.0030.00614.94
7.3.80.0070.00314.71
7.3.70.0100.00014.61
7.3.60.0060.00614.89
7.3.50.0140.00014.86
7.3.40.0030.00714.87
7.3.30.0060.00314.85
7.3.20.0070.00716.52
7.3.10.0040.01416.52
7.3.00.0070.00716.79
7.2.330.0060.01116.56
7.2.320.0030.01316.96
7.2.310.0060.01016.88
7.2.300.0070.01016.57
7.2.290.0030.01316.87
7.2.250.0100.00715.11
7.2.240.0070.01415.14
7.2.230.0030.01215.14
7.2.220.0070.00715.37
7.2.210.0100.00315.13
7.2.200.0030.01315.17
7.2.190.0040.01214.91
7.2.180.0060.00915.32
7.2.170.0070.01014.82
7.2.60.0030.01016.56
7.2.00.0000.01219.38
7.1.330.0040.01115.82
7.1.320.0080.00815.89
7.1.310.0100.00915.96
7.1.300.0090.00615.76
7.1.290.0060.01015.97
7.1.280.0060.00915.77
7.1.270.0030.00915.84
7.1.260.0080.00815.99
7.1.200.0000.01415.86
7.1.100.0680.01615.61
7.1.70.0070.00017.12
7.1.60.0070.01719.22
7.1.50.0100.00716.56
7.1.00.0030.07322.37
7.0.200.0030.00716.88
7.0.140.0070.06022.02
7.0.60.0170.06320.02
7.0.50.0130.07317.91
7.0.40.0030.05320.15
7.0.30.0330.07320.08
7.0.20.0370.05720.10
7.0.10.0030.05320.22
7.0.00.0070.08020.05
5.6.280.0070.07020.88
5.6.210.0130.08020.49
5.6.200.0000.04318.25
5.6.190.0100.08320.35
5.6.180.0300.07320.46
5.6.170.0330.07320.47
5.6.160.0070.08720.52
5.6.150.0000.04718.15
5.6.140.0130.07018.18
5.6.130.0070.08018.19
5.6.120.0130.06021.05
5.6.110.0100.06021.03
5.6.100.0070.08721.13
5.6.90.0100.08020.97
5.6.80.0200.06020.44
5.5.350.3030.03320.40
5.5.340.0030.09018.09
5.5.330.0100.04720.57
5.5.320.0230.05320.24
5.5.310.0170.04720.34
5.5.300.0100.07717.97
5.5.290.0030.05018.04
5.5.280.0100.03320.68
5.5.270.0030.05320.74
5.5.260.0070.07020.89
5.5.250.0130.06320.73
5.5.240.0270.07720.30
5.4.450.3130.03319.48
5.4.440.3100.04319.17
5.4.430.3000.04719.37
5.4.420.3270.03719.16
5.4.410.3400.04719.41
5.4.400.3300.03719.09
5.4.390.3200.04019.23
5.4.380.3170.03719.05
5.4.370.3000.03019.14
5.4.360.3070.04319.19
5.4.350.3270.03319.05
5.4.340.3030.02718.84
5.4.320.3170.04318.84
5.4.310.2930.03719.05
5.4.300.3730.04018.87
5.4.290.3130.03319.14
5.4.280.2970.04718.99
5.4.270.3070.03718.99
5.4.260.3100.03318.99
5.4.250.2770.03719.16
5.4.240.3200.03719.22
5.4.230.2800.03319.20
5.4.220.2900.04018.86
5.4.210.2900.03719.23
5.4.200.3000.03719.07
5.4.190.3630.04019.03
5.4.180.3030.03319.06
5.4.170.2870.03318.98
5.4.160.2970.03719.09
5.4.150.3200.03019.18
5.4.140.2900.03716.57
5.4.130.3170.04016.44
5.4.120.3200.03316.38
5.4.110.3200.03316.50
5.4.100.2930.03316.43
5.4.90.2600.04316.63
5.4.80.0070.06716.40
5.4.70.0030.06016.59
5.4.60.0070.07016.15
5.4.50.2400.04016.55
5.4.40.3500.04016.58
5.4.30.3400.03716.26
5.4.20.3330.03016.34
5.4.10.2970.04016.44
5.4.00.3230.03715.79
5.3.290.3400.04014.64
5.3.280.2970.03714.73
5.3.270.2400.03314.69
5.3.260.2700.03714.68
5.3.250.2830.03014.71
5.3.240.2930.03314.59
5.3.230.2930.03714.86
5.3.220.2730.03314.56
5.3.210.2570.04314.59
5.3.200.3000.03314.57
5.3.190.3130.03714.59
5.3.180.3030.02714.63
5.3.170.3030.04014.50
5.3.160.2770.03014.57
5.3.150.3000.03014.57
5.3.140.3100.04014.56
5.3.130.2900.04014.59
5.3.120.3070.02314.48
5.3.110.2900.03714.64
5.3.100.2930.03314.05
5.3.90.1800.04014.01
5.3.80.0070.04314.11
5.3.70.0130.03714.04
5.3.60.0100.07014.12
5.3.50.4530.03713.88
5.3.40.3670.03313.88
5.3.30.3400.02713.85
5.3.20.3030.03013.73
5.3.10.2970.03313.59
5.3.00.2970.03713.66
5.2.170.2730.03712.06
5.2.160.2670.02312.06
5.2.150.2600.03712.06
5.2.140.2830.03312.06
5.2.130.2730.02712.06
5.2.120.2700.02712.06
5.2.110.2600.02712.06
5.2.100.2700.02712.06
5.2.90.2870.03012.06
5.2.80.2700.03012.06
5.2.70.2700.03012.06
5.2.60.2500.02712.06
5.2.50.2800.03312.06
5.2.40.2230.03012.06
5.2.30.2200.03012.06
5.2.20.2130.03312.06
5.2.10.2130.03012.06
5.2.00.2070.02712.06
5.1.60.2270.02012.06
5.1.50.2000.02012.06
5.1.40.2300.02312.06
5.1.30.1970.02712.06
5.1.20.2030.03012.06
5.1.10.2230.02712.06
5.1.00.2270.02312.06
5.0.50.1230.02712.06
5.0.40.0970.02012.06
5.0.30.1000.02712.06
5.0.20.1230.02312.06
5.0.10.1030.01712.06
5.0.00.1130.03012.06
4.4.90.1030.01712.06
4.4.80.1030.01712.06
4.4.70.0930.02012.06
4.4.60.0970.01712.06
4.4.50.0930.01712.06
4.4.40.1200.03012.06
4.4.30.1100.02012.06
4.4.20.1200.02012.06
4.4.10.1030.01312.06
4.4.00.1230.03312.06
4.3.110.1200.01312.06
4.3.100.1070.02312.06
4.3.90.0970.01712.06
4.3.80.0930.03012.06
4.3.70.0870.01712.06
4.3.60.1230.01712.06
4.3.50.1230.02012.06
4.3.40.0970.02312.06
4.3.30.0500.01712.06
4.3.20.0570.02312.06
4.3.10.0670.01312.06
4.3.00.0630.02312.06

preferences:
41.37 ms | 401 KiB | 5 Q