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-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.56
8.3.50.0120.00621.90
8.3.40.0140.00718.96
8.3.30.0040.01119.20
8.3.20.0050.00320.52
8.3.10.0050.00323.69
8.3.00.0030.00719.02
8.2.180.0100.01016.50
8.2.170.0030.01022.96
8.2.160.0140.00022.16
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0000.00926.16
8.2.120.0040.00421.03
8.2.110.0090.00020.60
8.2.100.0120.00017.91
8.2.90.0000.00817.50
8.2.80.0050.00318.91
8.2.70.0100.00018.05
8.2.60.0040.00417.92
8.2.50.0050.00318.10
8.2.40.0040.00419.59
8.2.30.0040.00419.41
8.2.20.0030.00517.89
8.2.10.0040.00418.21
8.2.00.0030.00617.79
8.1.280.0180.00025.92
8.1.270.0000.00819.00
8.1.260.0030.00526.35
8.1.250.0040.00428.09
8.1.240.0030.00620.63
8.1.230.0040.00822.14
8.1.220.0050.00317.79
8.1.210.0050.00318.77
8.1.200.0030.00917.35
8.1.190.0000.00817.00
8.1.180.0060.00319.16
8.1.170.0090.00018.63
8.1.160.0040.00419.16
8.1.150.0040.00418.93
8.1.140.0040.00417.41
8.1.130.0030.00317.83
8.1.120.0030.00317.49
8.1.110.0100.00017.55
8.1.100.0040.00317.50
8.1.90.0040.00417.48
8.1.80.0000.00717.45
8.1.70.0040.00417.52
8.1.60.0000.00917.66
8.1.50.0000.00917.64
8.1.40.0040.00417.64
8.1.30.0000.00817.72
8.1.20.0000.00817.71
8.1.10.0050.00317.54
8.1.00.0000.00817.59
8.0.300.0050.00318.77
8.0.290.0040.00416.75
8.0.280.0040.00418.43
8.0.270.0000.00717.27
8.0.260.0090.00017.30
8.0.250.0040.00417.02
8.0.240.0040.00417.00
8.0.230.0080.00017.09
8.0.220.0040.00416.91
8.0.210.0050.00317.02
8.0.200.0040.00416.99
8.0.190.0000.00717.07
8.0.180.0100.00016.91
8.0.170.0000.00716.86
8.0.160.0000.00716.98
8.0.150.0040.00716.88
8.0.140.0070.00016.84
8.0.130.0030.00313.42
8.0.120.0050.00216.83
8.0.110.0040.00416.99
8.0.100.0040.00316.89
8.0.90.0050.00217.04
8.0.80.0030.01816.96
8.0.70.0000.00816.77
8.0.60.0050.00217.04
8.0.50.0040.00416.91
8.0.30.0120.01217.09
8.0.20.0130.00717.40
8.0.10.0040.00417.11
8.0.00.0080.01016.66
7.4.330.0000.00515.03
7.4.320.0060.00016.59
7.4.300.0000.00716.49
7.4.290.0030.00316.70
7.4.280.0030.00616.65
7.4.270.0000.00716.48
7.4.260.0050.00216.56
7.4.250.0040.00416.70
7.4.240.0020.00516.71
7.4.230.0000.00816.43
7.4.220.0070.01116.67
7.4.210.0040.01116.71
7.4.200.0000.00716.77
7.4.160.0030.01216.61
7.4.150.0100.01317.40
7.4.140.0060.01117.86
7.4.130.0090.01116.51
7.4.120.0090.01116.50
7.4.110.0110.01116.46
7.4.100.0030.01716.67
7.4.90.0130.00416.64
7.4.80.0150.00919.39
7.4.70.0150.00616.54
7.4.60.0070.01316.58
7.4.50.0040.00416.86
7.4.40.0040.01216.54
7.4.30.0070.01016.61
7.4.00.0090.00614.97
7.3.330.0060.00013.52
7.3.320.0000.00513.46
7.3.310.0040.00416.26
7.3.300.0030.00316.42
7.3.290.0020.01416.42
7.3.280.0110.00916.43
7.3.270.0190.00617.40
7.3.260.0070.01016.46
7.3.250.0060.01116.53
7.3.240.0080.01516.46
7.3.230.0150.00816.76
7.3.210.0130.01216.67
7.3.200.0070.01019.39
7.3.190.0060.00916.52
7.3.180.0060.01016.36
7.3.170.0170.00316.43
7.3.160.0100.00716.43
7.2.330.0070.01316.52
7.2.320.0140.00316.93
7.2.310.0140.00316.85
7.2.300.0100.01316.77
7.2.290.0180.00416.65
7.1.70.0040.00417.00
7.1.60.0110.01419.22
7.1.50.0100.01016.90
7.1.00.0000.07722.48
7.0.200.0000.00816.52
7.0.140.0000.03722.08
7.0.110.0170.03720.04
7.0.100.0130.03720.02
7.0.90.0270.04020.09
7.0.80.0230.06320.02
7.0.70.0070.07020.08
7.0.60.0070.08020.04
7.0.50.0200.07719.86
7.0.40.0100.07719.75
7.0.30.0100.07019.65
7.0.20.0100.04719.65
7.0.10.0070.04719.63
7.0.00.0000.06019.84
5.6.260.0070.04720.64
5.6.250.0070.03720.74
5.6.240.0100.03720.65
5.6.230.0130.05020.64
5.6.220.0100.07720.55
5.6.210.0100.05320.67
5.6.200.0100.04720.70
5.6.190.0070.05020.87
5.6.180.0230.03020.84
5.6.170.0270.04320.71
5.6.160.0200.06720.48
5.6.150.0130.04720.70
5.6.140.0000.04720.64
5.6.130.0000.08020.70
5.6.120.0130.05020.70
5.6.110.0130.07720.64
5.6.100.0030.07020.46
5.6.90.0070.07320.59
5.6.80.0030.06719.85
5.6.70.0030.05320.04
5.6.60.0070.08019.95
5.6.50.0170.07019.86
5.6.40.0070.08019.84
5.6.30.0100.04019.93
5.6.20.0100.07319.99
5.6.10.0070.04019.93
5.6.00.0130.07019.99
5.5.380.0000.03717.70
5.5.370.0070.03717.71
5.5.360.0100.08717.64
5.5.350.0030.07717.64
5.5.340.0070.07718.13
5.5.330.0000.05318.22
5.5.320.0070.05717.91
5.5.310.0100.07318.23
5.5.300.0100.05718.12
5.5.290.0100.04317.95
5.5.280.0070.08317.93
5.5.270.0070.05017.91
5.5.260.0070.07717.92
5.5.250.0070.06317.91
5.5.240.0100.03717.30
5.5.230.0030.07717.51
5.5.220.0070.04317.50
5.5.210.0070.06717.48
5.5.200.0100.04317.43
5.5.190.0030.06017.45
5.5.180.0100.05717.24
5.5.160.0130.07017.63
5.5.150.0100.07317.48
5.5.140.0100.03317.18
5.5.130.0030.04017.40
5.5.120.0030.04017.46
5.5.110.0070.04017.60
5.5.100.0030.04017.23
5.5.90.0100.05717.16
5.5.80.0130.04317.08
5.5.70.0100.07317.46
5.5.60.0070.06317.41
5.5.50.0130.06717.33
5.5.40.0130.05017.29
5.5.30.0130.06317.07
5.5.20.0070.05017.17
5.5.10.0070.03717.15
5.5.00.0030.08317.14
5.4.450.0070.06319.31
5.4.440.0000.08319.48
5.4.430.0000.06319.63
5.4.420.0030.04319.25
5.4.410.0030.05319.36
5.4.400.0030.05319.11
5.4.390.0130.07319.33
5.4.380.0030.07718.93
5.4.370.0030.07719.21
5.4.360.0070.05719.02
5.4.350.0070.03718.97
5.4.340.0200.03319.33
5.4.320.0030.06718.96
5.4.310.0100.05018.93
5.4.300.0100.04019.30
5.4.290.0070.04319.21
5.4.280.0000.06319.30
5.4.270.0070.04719.17
5.4.260.0070.07019.02
5.4.250.0100.06718.98
5.4.240.0070.04018.96
5.4.230.0130.07019.32
5.4.220.0130.03719.23
5.4.210.0100.07019.14
5.4.200.0100.06318.93
5.4.190.0070.08019.18
5.4.180.0000.04319.05
5.4.170.0030.07019.30
5.4.160.0000.05319.19
5.4.150.0030.04019.14
5.4.140.0030.03716.24
5.4.130.0070.03716.54
5.4.120.0030.07316.46
5.4.110.0030.05016.47
5.4.100.0030.03716.60
5.4.90.0070.03016.62
5.4.80.0070.06016.56
5.4.70.0130.06316.42
5.4.60.0100.07016.41
5.4.50.0030.03716.25
5.4.40.0100.03016.43
5.4.30.0030.03716.39
5.4.20.0100.03016.42
5.4.10.0030.05716.23
5.4.00.0070.03715.86
5.3.290.0070.03714.64
5.3.280.0130.06714.84
5.3.270.0030.04714.62
5.3.260.0000.05314.63
5.3.250.0100.03014.61
5.3.240.0070.03714.58
5.3.230.0030.07314.70
5.3.220.0000.03714.59
5.3.210.0030.03714.57
5.3.200.0070.07714.58
5.3.190.0100.05714.63
5.3.180.0030.07314.66
5.3.170.0130.06014.57
5.3.160.0030.05314.57
5.3.150.0030.03714.82
5.3.140.0100.06014.71
5.3.130.0030.04014.61
5.3.120.0000.04014.61
5.3.110.0030.05714.80
5.3.100.0030.03314.29
5.3.90.0100.07014.07
5.3.80.0070.04014.17
5.3.70.0070.03013.89
5.3.60.0030.06314.05
5.3.50.0000.04014.00
5.3.40.0070.04014.00
5.3.30.0000.03713.95
5.3.20.0030.03313.70
5.3.10.0000.07313.68
5.3.00.0030.04313.88
5.2.170.0000.03311.15
5.2.160.0030.02711.39
5.2.150.0070.02711.16
5.2.140.0070.04011.17
5.2.130.0030.04011.09
5.2.120.0030.04311.25
5.2.110.0170.02711.26
5.2.100.0030.03011.14
5.2.90.0000.03011.12
5.2.80.0070.03711.11
5.2.70.0000.03311.12
5.2.60.0070.02711.20
5.2.50.0070.04711.04
5.2.40.0070.05711.16
5.2.30.0070.03310.85
5.2.20.0000.03310.96
5.2.10.0030.03310.88
5.2.00.0000.03010.72
5.1.60.0030.03310.02
5.1.50.0030.02310.00
5.1.40.0000.04310.17
5.1.30.0030.02310.33
5.1.20.0070.03710.39
5.1.10.0030.03010.06
5.1.00.0030.02310.24
5.0.50.0030.0239.59
5.0.40.0030.0379.59
5.0.30.0000.0309.59
5.0.20.0000.0379.59
5.0.10.0030.0239.59
5.0.00.0030.0309.59
4.4.90.0000.0179.59
4.4.80.0030.0139.59
4.4.70.0000.0209.59
4.4.60.0030.0239.59
4.4.50.0100.0079.59
4.4.40.0030.0239.59
4.4.30.0000.0339.59
4.4.20.0000.0209.59
4.4.10.0000.0179.59
4.4.00.0000.0339.59
4.3.110.0000.0209.59
4.3.100.0100.0209.59
4.3.90.0000.0139.59
4.3.80.0000.0239.59
4.3.70.0000.0179.59
4.3.60.0030.0139.59
4.3.50.0000.0179.59
4.3.40.0030.0209.59
4.3.30.0000.0179.59
4.3.20.0000.0209.59
4.3.10.0000.0179.59
4.3.00.0000.0309.59

preferences:
42.62 ms | 401 KiB | 5 Q