3v4l.org

run code in 300+ PHP versions simultaneously
<?php function cleanUrl($value) { $url = parse_url($value); // Crap URLs (ie. without a scheme) only contain a path. if (!isset($url['host'])) { $url['host'] = rtrim($url['path'], '/'); $url['path'] = null; } $output = ''; $output .= !empty($url['scheme']) ? $url['scheme'] . '://' : 'http://'; // If unspecified, use HTTP. $output .= strtolower($url['host']); $output .= $url['path']; $output .= !empty($url['query']) ? '?' . $url['query'] : null; $output .= !empty($url['fragment']) ? '#' . $url['fragment'] : null; return $output; } cleanUrl('http://google.com');

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.70.0150.00016.88
8.3.60.0100.01016.62
8.3.50.0110.00821.93
8.3.40.0160.00918.98
8.3.30.0030.01019.18
8.3.20.0000.00720.29
8.3.10.0040.00423.65
8.3.00.0000.00819.50
8.2.180.0120.00618.66
8.2.170.0070.00722.96
8.2.160.0100.00720.39
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0040.00422.03
8.2.110.0000.00920.57
8.2.100.0110.00018.03
8.2.90.0050.00219.34
8.2.80.0000.00817.97
8.2.70.0040.00717.63
8.2.60.0080.00017.93
8.2.50.0000.00818.07
8.2.40.0090.00019.79
8.2.30.0000.00818.00
8.2.20.0030.00617.73
8.2.10.0030.00518.16
8.2.00.0040.00417.69
8.1.280.0070.00725.92
8.1.270.0080.00022.05
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00323.93
8.1.230.0030.00918.96
8.1.220.0040.00417.77
8.1.210.0040.00418.77
8.1.200.0090.00017.13
8.1.190.0080.00017.23
8.1.180.0030.00718.10
8.1.170.0050.00318.63
8.1.160.0000.00721.98
8.1.150.0000.00718.77
8.1.140.0000.00717.41
8.1.130.0000.00717.73
8.1.120.0070.00017.50
8.1.110.0030.00617.45
8.1.100.0030.00417.44
8.1.90.0030.00317.34
8.1.80.0000.00717.46
8.1.70.0030.00317.44
8.1.60.0030.00517.57
8.1.50.0040.00417.49
8.1.40.0000.00817.56
8.1.30.0040.00417.64
8.1.20.0000.00817.58
8.1.10.0040.00417.44
8.1.00.0060.00317.51
8.0.300.0050.00318.77
8.0.290.0040.00416.71
8.0.280.0050.00218.37
8.0.270.0080.00017.18
8.0.260.0000.00717.26
8.0.250.0030.00317.07
8.0.240.0000.00717.00
8.0.230.0040.00417.02
8.0.220.0070.00016.95
8.0.210.0000.00716.85
8.0.200.0030.00317.01
8.0.190.0040.00416.98
8.0.180.0000.00716.97
8.0.170.0040.00416.88
8.0.160.0030.00616.92
8.0.150.0000.00716.79
8.0.140.0040.00416.95
8.0.130.0050.00013.42
8.0.120.0080.00016.91
8.0.110.0000.00816.78
8.0.100.0000.00716.89
8.0.90.0060.00317.03
8.0.80.0040.01616.87
8.0.70.0060.00316.96
8.0.60.0020.00516.78
8.0.50.0050.00316.90
8.0.30.0160.00517.31
8.0.20.0100.00817.40
8.0.10.0030.00616.95
8.0.00.0080.01016.79
7.4.330.0020.00215.00
7.4.320.0030.00316.48
7.4.300.0030.00316.59
7.4.290.0030.00316.61
7.4.280.0030.00616.50
7.4.270.0080.00016.60
7.4.260.0030.00316.50
7.4.250.0030.00416.49
7.4.240.0030.00416.56
7.4.230.0030.00316.34
7.4.220.0140.00616.46
7.4.210.0110.00816.51
7.4.200.0000.00716.63
7.4.160.0180.00616.37
7.4.150.0090.01217.40
7.4.140.0130.00517.86
7.4.130.0070.01116.57
7.4.120.0100.00816.56
7.4.110.0080.01516.65
7.4.100.0100.00716.52
7.4.90.0140.00316.47
7.4.80.0110.00719.39
7.4.70.0090.00816.43
7.4.60.0070.01716.53
7.4.50.0000.00816.64
7.4.40.0120.00916.71
7.4.30.0130.00716.36
7.4.00.0040.01114.89
7.3.330.0030.00313.43
7.3.320.0050.00013.43
7.3.310.0000.00716.44
7.3.300.0070.00016.46
7.3.290.0110.00816.30
7.3.280.0070.00916.37
7.3.270.0110.01117.40
7.3.260.0000.01716.38
7.3.240.0110.00716.32
7.3.230.0150.00316.43
7.3.210.0140.00416.48
7.3.200.0220.02419.39
7.3.190.0000.01616.33
7.3.180.0090.00616.34
7.3.170.0070.01016.64
7.3.160.0110.00616.39
7.2.330.0120.00616.59
7.2.320.0060.01216.89
7.2.310.0030.01416.40
7.2.300.0080.01316.59
7.2.290.0090.01216.75
7.2.00.0030.01019.41
7.1.100.0000.01418.24
7.1.70.0140.00317.20
7.1.60.0100.01319.32
7.1.50.0030.00717.11
7.1.00.0100.07022.34
7.0.200.0030.00616.68
7.0.140.0100.06721.97
7.0.60.0070.08319.94
7.0.50.0030.04717.93
7.0.40.0070.08320.25
7.0.30.0470.05720.19
7.0.20.0270.07720.16
7.0.10.0230.06320.30
7.0.00.0070.07320.12
5.6.280.0170.06321.13
5.6.210.0170.07320.77
5.6.200.0070.09018.23
5.6.190.0100.08020.47
5.6.180.0330.07720.77
5.6.170.0200.03720.44
5.6.160.0070.08720.50
5.6.150.0070.07718.29
5.6.140.0070.08318.16
5.6.130.0200.07018.11
5.6.120.0070.08720.79
5.6.110.0070.07720.98
5.6.100.0100.03720.89
5.6.90.0130.05321.02
5.6.80.0130.07720.36
5.5.350.0200.07720.39
5.5.340.0130.07717.92
5.5.330.0070.04320.25
5.5.320.0370.05020.30
5.5.310.0170.08020.29
5.5.300.0030.03717.93
5.5.290.0000.04317.97
5.5.280.0030.04320.78
5.5.270.0170.07720.95
5.5.260.0100.08320.88
5.5.250.0070.07320.72
5.5.240.0270.07720.25
5.4.450.0200.04719.33
5.4.440.0830.06719.17
5.4.430.0830.05019.19
5.4.420.0670.00019.56
5.4.410.0670.00019.58
5.4.400.0630.00018.92
5.4.390.0600.00019.17
5.4.380.0630.00018.99
5.4.370.0630.00019.16
5.4.360.0600.00019.13
5.4.350.0630.00019.16
5.4.340.0080.04512.02
5.4.320.0090.04712.51
5.4.310.0120.04112.50
5.4.300.0070.04912.51
5.4.290.0100.05012.50
5.4.280.0070.04412.40
5.4.270.0080.03512.40
5.4.260.0100.04212.40
5.4.250.0060.04412.40
5.4.240.0090.04512.40
5.4.230.0070.04012.39
5.4.220.0030.03812.39
5.4.210.0080.03312.39
5.4.200.0050.03812.39
5.4.190.0040.03812.38
5.4.180.0050.03612.39
5.4.170.0050.04412.39
5.4.160.0060.04012.39
5.4.150.0070.03712.39
5.4.140.0070.04012.07
5.4.130.0060.03812.05
5.4.120.0040.03812.02
5.4.110.0070.03612.01
5.4.100.0060.03412.02
5.4.90.0070.03512.01
5.4.80.0060.03712.01
5.4.70.0070.03412.01
5.4.60.0090.03512.01
5.4.50.0070.04012.01
5.4.40.0040.03711.99
5.4.30.0060.03612.00
5.4.20.0140.04412.00
5.4.10.0090.04611.99
5.4.00.0050.04611.48
5.3.290.0060.04612.80
5.3.280.0070.04412.71
5.3.270.0040.04612.73
5.3.260.0050.04012.72
5.3.250.0060.03712.72
5.3.240.0090.03412.71
5.3.230.0020.04212.71
5.3.220.0060.03812.68
5.3.210.0060.03812.68
5.3.200.0110.03212.68
5.3.190.0020.04412.68
5.3.180.0070.04012.67
5.3.170.0100.05012.67
5.3.160.0070.03712.67
5.3.150.0050.03812.68
5.3.140.0050.03712.66
5.3.130.0060.03812.65
5.3.120.0060.04012.66
5.3.110.0050.04012.66
5.3.100.0050.03812.12
5.3.90.0070.03512.10
5.3.80.0030.03912.09
5.3.70.0050.03812.09
5.3.60.0100.03212.08
5.3.50.0050.03712.02
5.3.40.0050.03712.02
5.3.30.0080.03411.98
5.3.20.0080.03311.76
5.3.10.0060.03411.73
5.3.00.0060.03511.71
5.2.170.0060.0289.21
5.2.160.0080.0319.21
5.2.150.0060.0329.21
5.2.140.0040.0319.21
5.2.130.0060.0309.17
5.2.120.0030.0329.17
5.2.110.0040.0319.18
5.2.100.0030.0319.17
5.2.90.0050.0319.17
5.2.80.0080.0309.17
5.2.70.0050.0319.17
5.2.60.0060.0339.13
5.2.50.0050.0339.09
5.2.40.0050.0299.07
5.2.30.0030.0319.04
5.2.20.0080.0269.03
5.2.10.0060.0278.94
5.2.00.0060.0288.80
5.1.60.0040.0268.08
5.1.50.0050.0278.08
5.1.40.0030.0298.06
5.1.30.0040.0328.41
5.1.20.0020.0408.44
5.1.10.0050.0318.16
5.1.00.0050.0288.16
5.0.50.0020.0226.65
5.0.40.0030.0196.52
5.0.30.0040.0346.32
5.0.20.0050.0206.29
5.0.10.0020.0216.28
5.0.00.0060.0296.26
4.4.90.0030.0174.78
4.4.80.0020.0184.75
4.4.70.0020.0174.76
4.4.60.0030.0154.75
4.4.50.0020.0164.77
4.4.40.0020.0284.71
4.4.30.0050.0194.76
4.4.20.0040.0204.84
4.4.10.0030.0154.84
4.4.00.0030.0254.76
4.3.110.0010.0184.67
4.3.100.0030.0154.67
4.3.90.0040.0134.63
4.3.80.0010.0264.59
4.3.70.0060.0114.63
4.3.60.0020.0164.63
4.3.50.0020.0204.63
4.3.40.0030.0274.54
4.3.30.0010.0173.31
4.3.20.0010.0173.29
4.3.10.0070.0143.26
4.3.00.0170.0207.32

preferences:
50.53 ms | 401 KiB | 5 Q