3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Return domain name from url * For example: "all.ru" from "http://www.all.ru/test/test.html" * * @param $url * @param bool $with_www * @return string : domain name */ function get_domain($url, $with_www = false) { $url = preg_replace('~^(?:f|ht)tps?://~i', '', trim($url)); $path = explode ('/', $url); $domain = strtolower(trim($path[0])); $domain = preg_replace('#^www.#', '', $domain); if($with_www) { $domain = 'www.' . $domain; } return $domain; } /** * Format URL * * @param $url * @return string */ function format_url($url) { if(parse_url($url, PHP_URL_SCHEME) === null) { $url = 'http://' . $url; //parse_url() requires scheme to parse URL correctly } $parsed_url = parse_url($url); $formatted_url = get_domain($parsed_url['host'], false); if (isset($parsed_url['path'])) { $formatted_url .= preg_replace('#index\.[a-z]+#', '', $parsed_url['path']); } if (isset($parsed_url['query'])) { $url .= '?' . $parsed_url['query']; } $url = rtrim($url, '/'); var_dump($url); return $url; } /** * Compare two formatted urls * * @param string $url_1 * @param string $url_2 * @return bool */ function compare_urls($url_1, $url_2) { return format_url($url_1) === format_url($url_2); } $url_1 = 'https://seos.bolseo.ru/index.php?'; $url_2 = 'seos.bolseo.ru'; var_dump(compare_urls($url_1, $url_2));

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.50
8.3.50.0110.00922.02
8.3.40.0000.01518.92
8.3.30.0070.00719.22
8.3.20.0090.00020.33
8.3.10.0080.00022.04
8.3.00.0040.00422.38
8.2.180.0070.01016.88
8.2.170.0110.00422.96
8.2.160.0100.00321.24
8.2.150.0080.00024.18
8.2.140.0000.00924.66
8.2.130.0070.00026.16
8.2.120.0040.00420.95
8.2.110.0030.00620.95
8.2.100.0080.00317.97
8.2.90.0070.00319.26
8.2.80.0080.00017.97
8.2.70.0060.00318.00
8.2.60.0030.00517.93
8.2.50.0000.01118.10
8.2.40.0080.00018.28
8.2.30.0040.00418.06
8.2.20.0040.00417.84
8.2.10.0060.00319.68
8.2.00.0050.00317.97
8.1.280.0150.00625.92
8.1.270.0140.00422.10
8.1.260.0080.00826.35
8.1.250.0000.00928.09
8.1.240.0030.00622.75
8.1.230.0000.01117.95
8.1.220.0000.00817.89
8.1.210.0030.00618.77
8.1.200.0030.00617.60
8.1.190.0050.00317.48
8.1.180.0000.00818.10
8.1.170.0040.00418.79
8.1.160.0040.00421.93
8.1.150.0030.00518.68
8.1.140.0040.00417.58
8.1.130.0000.00817.89
8.1.120.0050.00317.61
8.1.110.0000.00717.51
8.1.100.0000.00717.48
8.1.90.0000.00717.44
8.1.80.0040.00417.64
8.1.70.0000.00717.48
8.1.60.0030.00617.79
8.1.50.0080.00017.59
8.1.40.0000.00817.65
8.1.30.0050.00317.76
8.1.20.0000.00817.68
8.1.10.0030.00517.79
8.1.00.0000.00917.56
8.0.300.0040.00418.77
8.0.290.0060.00316.88
8.0.280.0070.00018.51
8.0.270.0000.00717.24
8.0.260.0030.00317.04
8.0.250.0040.00417.16
8.0.240.0070.00017.13
8.0.230.0030.00317.16
8.0.220.0070.00017.11
8.0.210.0000.00717.03
8.0.200.0030.00317.05
8.0.190.0040.00417.14
8.0.180.0000.00717.08
8.0.170.0040.00417.09
8.0.160.0070.00016.97
8.0.150.0040.00417.05
8.0.140.0070.00017.09
8.0.130.0060.00013.60
8.0.120.0000.00816.95
8.0.110.0040.00416.90
8.0.100.0040.00417.11
8.0.90.0040.00416.93
8.0.80.0060.00917.08
8.0.70.0040.00416.81
8.0.60.0000.00716.91
8.0.50.0030.00517.03
8.0.30.0050.01517.10
8.0.20.0060.01317.63
8.0.10.0040.00417.04
8.0.00.0070.01117.00
7.4.330.0070.00015.00
7.4.320.0000.00616.86
7.4.300.0030.00316.78
7.4.290.0030.00516.86
7.4.280.0000.00716.82
7.4.270.0000.00716.85
7.4.260.0000.01116.88
7.4.250.0040.00416.81
7.4.240.0020.00516.89
7.4.230.0000.00716.90
7.4.220.0120.00416.78
7.4.210.0090.00816.85
7.4.200.0050.00216.86
7.4.190.0050.00216.62
7.4.160.0060.00916.79
7.4.150.0030.01517.40
7.4.140.0090.01617.86
7.4.130.0100.00816.60
7.4.120.0060.01116.73
7.4.110.0080.00816.71
7.4.100.0160.00716.85
7.4.90.0110.00716.71
7.4.80.0070.01019.39
7.4.70.0030.01316.70
7.4.60.0040.01416.65
7.4.50.0050.00016.63
7.4.40.0060.00622.77
7.4.30.0070.01016.70
7.4.00.0100.00715.28
7.3.330.0000.00513.33
7.3.320.0000.00513.54
7.3.310.0040.00416.59
7.3.300.0030.00316.60
7.3.290.0100.01016.50
7.3.280.0080.01016.55
7.3.270.0120.00617.40
7.3.260.0070.01016.57
7.3.250.0050.01216.73
7.3.240.0070.01016.66
7.3.230.0040.01216.54
7.3.210.0090.00916.77
7.3.200.0180.00019.39
7.3.190.0070.01116.81
7.3.180.0100.00616.59
7.3.170.0030.01216.73
7.3.160.0070.01016.68
7.3.120.0040.00715.07
7.3.10.0090.00816.80
7.3.00.0060.00616.85
7.2.330.0110.00716.95
7.2.320.0030.01517.04
7.2.310.0030.01416.89
7.2.300.0130.00917.02
7.2.290.0160.00616.89
7.2.130.0090.00517.17
7.2.120.0080.00717.04
7.2.110.0050.01017.07
7.2.100.0050.00517.04
7.2.90.0100.00817.11
7.2.80.0080.00717.28
7.2.70.0120.00817.23
7.2.60.0090.00517.06
7.2.50.0060.00917.04
7.2.40.0130.00516.99
7.2.30.0060.00617.09
7.2.20.0060.01017.17
7.2.10.0050.00716.98
7.2.00.0030.00917.94
7.1.250.0060.00315.91
7.1.100.0000.01018.56
7.1.70.0030.00517.34
7.1.60.0120.01219.82
7.1.50.0070.01816.89
7.1.00.0100.06322.49
7.0.200.0030.01016.66
7.0.140.0000.07722.09
7.0.100.0230.04019.95
7.0.90.0400.03019.97
7.0.80.0300.08320.05
7.0.70.0370.04319.92
7.0.60.0430.07019.89
7.0.50.0270.06020.28
7.0.40.0100.07320.03
7.0.30.0100.04720.07
7.0.20.0070.09720.07
7.0.10.0070.06019.94
7.0.00.0130.08020.04
5.6.280.0000.07720.90
5.6.250.0030.06720.67
5.6.240.0030.04720.61
5.6.230.0070.05320.76
5.6.220.0130.07320.64
5.6.210.0100.05020.59
5.6.200.0070.08721.08
5.6.190.0070.08321.02
5.6.180.0100.08320.95
5.6.170.0030.09020.96
5.6.160.0030.08720.97
5.6.150.0100.05021.15
5.6.140.0030.08720.94
5.6.130.0030.08721.17
5.6.120.0030.08721.05
5.6.110.0070.04721.06
5.6.100.0030.08020.96
5.6.90.0200.07021.08
5.6.80.0070.08320.42
5.6.70.0070.08320.43
5.6.60.0100.08020.50
5.6.50.0130.07320.33
5.6.40.0130.07320.41
5.6.30.0130.08020.46
5.6.20.0000.08720.41
5.6.10.0100.08020.54
5.6.00.0130.07720.43
5.5.380.0100.08320.39
5.5.370.0100.07720.58
5.5.360.0100.07020.42
5.5.350.0070.08320.46
5.5.340.0100.07720.66
5.5.330.0200.05720.77
5.5.320.0230.04320.93
5.5.310.0170.07320.85
5.5.300.0070.06720.79
5.5.290.0070.08720.73
5.5.280.0030.04720.90
5.5.270.0100.07720.65
5.5.260.0130.03320.88
5.5.250.0100.06720.65
5.5.240.0100.05320.13
5.5.230.0130.06720.15
5.5.220.0100.04320.14
5.5.210.0100.07320.22
5.5.200.0070.08020.13
5.5.190.0070.05320.25
5.5.180.0030.09020.27
5.5.160.0130.07720.29
5.5.150.0130.07320.30
5.5.140.0130.08020.00
5.5.130.0030.08720.24
5.5.120.0170.07020.16
5.5.110.0270.06020.27
5.5.100.0170.07020.18
5.5.90.0070.07720.02
5.5.80.0100.05720.09
5.5.70.0170.06720.21
5.5.60.0130.06720.09
5.5.50.0170.07319.95
5.5.40.0130.07020.17
5.5.30.0030.07720.06
5.5.20.0030.07320.01
5.5.10.0130.06320.13
5.5.00.0070.07720.07
5.4.450.0070.08019.43
5.4.440.0000.08319.51
5.4.430.0070.07019.44
5.4.420.0130.07319.55
5.4.410.0100.07019.32
5.4.400.0030.08319.04
5.4.390.0030.06719.23
5.4.380.0030.08318.85
5.4.370.0070.07719.13
5.4.360.0100.06319.14
5.4.350.0100.06719.18
5.4.340.0200.06319.16
5.4.320.0030.04318.90
5.4.310.0070.05318.95
5.4.300.0070.08019.16
5.4.290.0200.06019.03
5.4.280.0100.05019.18
5.4.270.0030.07019.23
5.4.260.0170.06719.18
5.4.250.0070.04719.03
5.4.240.0130.07319.11
5.4.230.0070.07319.17
5.4.220.0100.07318.94
5.4.210.0070.06019.12
5.4.200.0070.06319.02
5.4.190.0170.06319.15
5.4.180.0170.07018.89
5.4.170.0170.07718.93
5.4.160.0130.07018.89
5.4.150.0100.07019.11
5.4.140.0130.03716.47
5.4.130.0000.06716.36
5.4.120.0130.06716.30
5.4.110.0030.04016.55
5.4.100.0070.07016.52
5.4.90.0030.07316.54
5.4.80.0100.07316.54
5.4.70.0130.06716.53
5.4.60.0100.07016.41
5.4.50.0070.07716.36
5.4.40.0100.05316.37
5.4.30.0130.06316.44
5.4.20.0070.07716.39
5.4.10.0070.04716.45
5.4.00.0070.03715.79
5.3.290.0030.08014.64
5.3.280.0170.07014.62
5.3.270.0130.06714.66
5.3.260.0100.07014.58
5.3.250.0030.04314.62
5.3.240.0100.07314.60
5.3.230.0100.07014.61
5.3.220.0100.06314.64
5.3.210.0100.07014.51
5.3.200.0000.08314.51
5.3.190.0070.07714.57
5.3.180.0100.07014.54
5.3.170.0030.07714.71
5.3.160.0170.07014.63
5.3.150.0000.08014.56
5.3.140.0100.07014.71
5.3.130.0030.07714.59
5.3.120.0130.07014.48
5.3.110.0070.07014.54
5.3.100.0070.06014.03
5.3.90.0030.04014.00
5.3.80.0200.04314.13
5.3.70.0070.03314.09
5.3.60.0100.03014.08
5.3.50.0000.04013.88
5.3.40.0030.04014.08
5.3.30.0070.03713.96
5.3.20.0100.03013.82
5.3.10.0030.03713.71
5.3.00.0100.03713.74
5.2.170.0030.03011.89
5.2.160.0000.03311.89
5.2.150.0030.03011.89
5.2.140.0070.02711.89
5.2.130.0030.03311.89
5.2.120.0070.02711.89
5.2.110.0000.03011.89
5.2.100.0030.02711.89
5.2.90.0030.02711.89
5.2.80.0000.03011.89
5.2.70.0030.02711.89
5.2.60.0030.04311.89
5.2.50.0070.02711.89
5.2.40.0030.06011.89
5.2.30.0030.04011.89
5.2.20.0030.03011.89
5.2.10.0030.02711.89
5.2.00.0000.03311.89
5.1.60.0030.05311.89
5.1.50.0000.03311.89
5.1.40.0030.04011.89
5.1.30.0070.02011.89
5.1.20.0100.02011.89
5.1.10.0000.02711.89
5.1.00.0030.02311.89
5.0.50.0000.02011.89
5.0.40.0000.03311.89
5.0.30.0070.02711.89
5.0.20.0070.01711.89
5.0.10.0070.01311.89
5.0.00.0000.03711.89
4.4.90.0070.02711.89
4.4.80.0030.01311.89
4.4.70.0000.02011.89
4.4.60.0000.02311.89
4.4.50.0000.01711.89
4.4.40.0030.02711.89
4.4.30.0000.02011.89
4.4.20.0000.01711.89
4.4.10.0000.01711.89
4.4.00.0000.02711.89
4.3.110.0030.01011.89
4.3.100.0000.01711.89
4.3.90.0000.01711.89
4.3.80.0000.02311.89
4.3.70.0000.01311.89
4.3.60.0030.03011.89
4.3.50.0000.02011.89
4.3.40.0030.02011.89
4.3.30.0000.01311.89
4.3.20.0030.01711.89
4.3.10.0000.01311.89
4.3.00.0030.02711.89

preferences:
39.92 ms | 401 KiB | 5 Q