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; } print 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.60.0070.01016.75
8.3.50.0170.00721.94
8.3.40.0090.00618.59
8.3.30.0070.00719.25
8.3.20.0040.00420.18
8.3.10.0050.00323.53
8.3.00.0050.00319.38
8.2.180.0080.00818.54
8.2.170.0140.00722.96
8.2.160.0110.00320.57
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0000.00822.24
8.2.110.0060.00320.35
8.2.100.0080.00318.09
8.2.90.0070.00019.22
8.2.80.0000.00817.97
8.2.70.0030.00617.75
8.2.60.0030.00517.93
8.2.50.0080.00418.07
8.2.40.0080.00019.88
8.2.30.0000.00718.06
8.2.20.0040.00417.69
8.2.10.0050.00218.10
8.2.00.0030.00617.73
8.1.280.0110.01125.92
8.1.270.0040.00422.00
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0030.00723.83
8.1.230.0040.00719.07
8.1.220.0040.00417.74
8.1.210.0030.00618.77
8.1.200.0060.00317.23
8.1.190.0050.00317.23
8.1.180.0040.00418.10
8.1.170.0000.00918.64
8.1.160.0000.00722.02
8.1.150.0030.00518.87
8.1.140.0030.00617.41
8.1.130.0000.00717.88
8.1.120.0050.00317.45
8.1.110.0000.00917.45
8.1.100.0080.00017.29
8.1.90.0040.00417.36
8.1.80.0050.00217.45
8.1.70.0030.00317.44
8.1.60.0000.00917.60
8.1.50.0050.00317.52
8.1.40.0000.00717.46
8.1.30.0030.00617.50
8.1.20.0100.00017.67
8.1.10.0060.00317.62
8.1.00.0040.00417.43
8.0.300.0040.00418.77
8.0.290.0050.00216.75
8.0.280.0030.00318.43
8.0.270.0000.00817.26
8.0.260.0060.00017.26
8.0.250.0030.00317.03
8.0.240.0030.00316.98
8.0.230.0000.00716.99
8.0.220.0030.00316.98
8.0.210.0030.00316.79
8.0.200.0030.00516.85
8.0.190.0040.00416.88
8.0.180.0040.00416.94
8.0.170.0080.00016.86
8.0.160.0080.00416.98
8.0.150.0040.00416.94
8.0.140.0000.00816.92
8.0.130.0030.00313.39
8.0.120.0030.00516.82
8.0.110.0040.00416.91
8.0.100.0040.00416.99
8.0.90.0070.00016.93
8.0.80.0140.00716.94
8.0.70.0060.00316.96
8.0.60.0040.00417.00
8.0.50.0040.00416.98
8.0.30.0130.00617.05
8.0.20.0140.00817.40
8.0.10.0060.00317.17
8.0.00.0050.01316.72
7.4.330.0050.00015.00
7.4.320.0030.00316.61
7.4.300.0000.00616.53
7.4.290.0070.00016.61
7.4.280.0000.00716.60
7.4.270.0030.00316.49
7.4.260.0000.00716.54
7.4.250.0040.00416.38
7.4.240.0060.00216.57
7.4.230.0000.00716.68
7.4.220.0060.01316.67
7.4.210.0090.00616.46
7.4.200.0070.00016.42
7.4.160.0110.00716.52
7.4.150.0110.00817.40
7.4.140.0130.00717.86
7.4.130.0070.00916.53
7.4.120.0090.00916.36
7.4.110.0000.01816.59
7.4.100.0070.01116.55
7.4.90.0090.00916.55
7.4.80.0180.00419.39
7.4.70.0110.00516.66
7.4.60.0100.00716.49
7.4.50.0030.00316.57
7.4.40.0030.01316.45
7.4.30.0110.00716.45
7.4.00.0060.01115.13
7.3.330.0000.00513.30
7.3.320.0000.00513.42
7.3.310.0000.00716.46
7.3.300.0000.00716.30
7.3.290.0080.00816.37
7.3.280.0050.01016.31
7.3.270.0110.00817.40
7.3.260.0140.00716.42
7.3.250.0070.01116.45
7.3.240.0140.01016.27
7.3.230.0100.00716.39
7.3.210.0090.00616.47
7.3.200.0070.01019.39
7.3.190.0040.01316.29
7.3.180.0070.01016.36
7.3.170.0060.00916.38
7.3.160.0090.00616.38
7.3.120.0130.00314.86
7.3.110.0090.00514.73
7.3.100.0000.01314.86
7.3.90.0050.00914.94
7.3.80.0080.00314.77
7.3.70.0020.01014.84
7.3.60.0030.00714.66
7.3.50.0040.00814.77
7.3.40.0050.01014.79
7.3.30.0020.01314.79
7.3.20.0050.00816.61
7.3.10.0080.00516.50
7.3.00.0040.00816.43
7.2.330.0070.01416.65
7.2.320.0100.00716.83
7.2.310.0140.00316.87
7.2.300.0090.01216.87
7.2.290.0130.01016.60
7.2.250.0050.01115.33
7.2.240.0070.01415.04
7.2.230.0110.00515.31
7.2.220.0040.00814.89
7.2.210.0020.00915.22
7.2.200.0050.01015.13
7.2.190.0050.00415.09
7.2.180.0030.00915.02
7.2.170.0040.01315.15
7.2.130.0060.00816.56
7.2.120.0100.00216.77
7.2.110.0100.00516.80
7.2.100.0050.00816.98
7.2.90.0070.00816.92
7.2.80.0100.00216.78
7.2.70.0050.00516.85
7.2.60.0100.00416.77
7.2.50.0070.00716.65
7.2.40.0090.00516.94
7.2.30.0070.00816.80
7.2.20.0030.01116.79
7.2.10.0100.00516.66
7.2.00.0110.00817.62
7.1.330.0110.00515.72
7.1.320.0060.00815.78
7.1.310.0090.00416.03
7.1.300.0040.00715.75
7.1.290.0090.00615.72
7.1.280.0070.00715.74
7.1.270.0030.00915.87
7.1.260.0050.00715.69
7.1.250.0030.00915.62
7.1.100.0060.00918.19
7.1.70.0040.00417.14
7.1.60.0070.01819.32
7.1.50.0070.00416.93
7.1.00.0000.08022.35
7.0.200.0000.01016.64
7.0.140.0070.07021.92
7.0.60.0030.07320.01
7.0.50.0070.03717.89
7.0.40.0070.08720.41
7.0.30.0270.04020.10
7.0.20.0400.07320.06
7.0.10.0100.04020.24
7.0.00.0070.06020.07
5.6.280.0000.07720.87
5.6.210.0100.07020.70
5.6.200.0030.06718.23
5.6.190.0200.07720.50
5.6.180.0330.04320.57
5.6.170.0330.07320.58
5.6.160.0030.04020.52
5.6.150.0100.05018.24
5.6.140.0100.07318.18
5.6.130.0270.04018.18
5.6.120.0030.04320.97
5.6.110.0230.07721.14
5.6.100.0100.04021.05
5.6.90.0030.04320.89
5.6.80.0170.07020.49
5.5.350.3870.04720.44
5.5.340.0030.08317.96
5.5.330.0000.04320.19
5.5.320.0030.04320.31
5.5.310.0370.07320.23
5.5.300.0130.07317.97
5.5.290.0000.04717.94
5.5.280.0100.08320.85
5.5.270.0030.08720.84
5.5.260.0130.08020.80
5.5.250.0200.08020.66
5.5.240.0200.04020.24
5.4.450.0130.04019.55
5.4.440.0170.03719.18
5.4.430.0130.04019.30
5.4.420.0170.03719.47
5.4.410.0130.04319.41
5.4.400.0170.03318.98
5.4.390.0100.04019.11
5.4.380.0200.03719.31
5.4.370.0130.04718.87
5.4.360.0230.06319.22
5.4.350.0230.06719.16
5.4.340.0230.07019.20
5.4.320.0170.04019.15
5.4.310.0300.06719.20
5.4.300.0300.05018.85
5.4.290.0270.05718.87
5.4.280.0200.05719.31
5.4.270.0270.04019.07
5.4.260.0330.03019.22
5.4.250.0230.04018.87
5.4.240.0270.05719.21
5.4.230.0170.05018.99
5.4.220.0300.06319.08
5.4.210.0200.04019.07
5.4.200.0270.07318.85
5.4.190.0270.07018.83
5.4.180.0300.06319.32
5.4.170.0330.05719.19
5.4.160.0270.07019.07
5.4.150.0300.05719.20
5.4.140.0230.07016.52
5.4.130.0270.05716.45
5.4.120.0300.06016.50
5.4.110.0270.06716.51
5.4.100.0230.04716.35
5.4.90.0200.07316.30
5.4.80.0230.05716.57
5.4.70.0270.05016.43
5.4.60.0300.05316.24
5.4.50.0170.04016.55
5.4.40.0300.03316.43
5.4.30.0570.04016.16
5.4.20.0330.04716.48
5.4.10.0200.04316.55
5.4.00.0200.03315.96
5.3.290.0230.08314.56
5.3.280.0270.07014.52
5.3.270.0130.05314.58
5.3.260.0200.06314.59
5.3.250.0270.06714.63
5.3.240.0270.07014.52
5.3.230.0300.06714.50
5.3.220.0130.05014.64
5.3.210.0300.04014.54
5.3.200.0230.04014.79
5.3.190.0300.06714.68
5.3.180.0230.06014.72
5.3.170.0330.05014.46
5.3.160.0300.03314.46
5.3.150.0200.07314.55
5.3.140.0200.03714.63
5.3.130.0200.05314.45
5.3.120.0300.07014.45
5.3.110.0270.07014.55
5.3.100.0270.06013.93
5.3.90.0270.07314.11
5.3.80.0300.04714.06
5.3.70.0270.04314.09
5.3.60.0270.06714.23
5.3.50.0230.06313.92
5.3.40.0300.05314.01
5.3.30.0230.05313.99
5.3.20.0230.03313.91
5.3.10.0270.05713.73
5.3.00.0230.06013.73
5.2.170.0200.06313.73
5.2.160.0200.04713.73
5.2.150.0170.04713.73
5.2.140.0270.05013.73
5.2.130.0200.04313.73
5.2.120.0200.06013.73
5.2.110.0230.05313.73
5.2.100.0230.05013.73
5.2.90.0230.05013.73
5.2.80.0270.05313.73
5.2.70.0270.05013.73
5.2.60.0270.05313.73
5.2.50.0170.05313.73
5.2.40.0170.05713.73
5.2.30.0230.03313.73
5.2.20.0130.03713.73
5.2.10.0130.04713.73
5.2.00.0130.06013.73
5.1.60.0170.05013.73
5.1.50.0130.05313.73
5.1.40.0230.04713.73
5.1.30.0200.05313.73
5.1.20.0200.04713.73
5.1.10.0200.05013.73
5.1.00.0170.02713.73
5.0.50.0100.04313.73
5.0.40.0130.05013.73
5.0.30.0100.06713.73
5.0.20.0130.02713.73
5.0.10.0100.04313.73
5.0.00.0100.06013.73
4.4.90.0070.03713.73
4.4.80.0100.03313.73
4.4.70.0100.01713.73
4.4.60.0070.02013.73
4.4.50.0130.02313.73
4.4.40.0070.05013.73
4.4.30.0100.03313.73
4.4.20.0070.02313.73
4.4.10.0070.02313.73
4.4.00.0130.02713.73
4.3.110.0100.03013.73
4.3.100.0100.02713.73
4.3.90.0130.01713.73
4.3.80.0070.04013.73
4.3.70.0070.03713.73
4.3.60.0130.02713.73
4.3.50.0100.03013.73
4.3.40.0100.04713.73
4.3.30.0070.03013.73
4.3.20.0030.03713.73
4.3.10.0030.04013.73
4.3.00.0070.03313.73

preferences:
49.72 ms | 401 KiB | 5 Q