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); $host = get_domain($parsed_url['host'], false); $path = preg_replace('#index\.[a-z]+#', '', $parsed_url['path']); $url = $host . $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?module=2&siteID=235'; $url_2 = 'seos.bolseo.ru/index.html?module=2&siteID=235'; 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.0040.01118.56
8.3.50.0120.00722.20
8.3.40.0140.00719.04
8.3.30.0110.01119.21
8.3.20.0100.01020.05
8.3.10.0040.01122.15
8.3.00.0040.00422.38
8.2.180.0130.01016.88
8.2.170.0100.01022.96
8.2.160.0080.00821.20
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0110.00326.16
8.2.120.0030.00519.73
8.2.110.0030.00622.21
8.2.100.0000.01117.76
8.2.90.0080.00019.34
8.2.80.0080.00019.66
8.2.70.0040.00417.75
8.2.60.0130.00018.03
8.2.50.0070.00318.07
8.2.40.0000.00818.34
8.2.30.0000.00818.27
8.2.20.0040.00417.91
8.2.10.0080.00019.55
8.2.00.0060.00317.93
8.1.280.0180.00025.92
8.1.270.0110.00722.13
8.1.260.0050.00226.35
8.1.250.0070.00728.09
8.1.240.0060.00323.71
8.1.230.0060.00619.00
8.1.220.0050.00317.91
8.1.210.0030.00618.77
8.1.200.0030.00717.46
8.1.190.0040.00417.63
8.1.180.0000.00918.10
8.1.170.0040.00418.63
8.1.160.0000.00722.00
8.1.150.0030.00518.77
8.1.140.0040.00417.46
8.1.130.0040.00417.91
8.1.120.0050.00217.57
8.1.110.0080.00017.58
8.1.100.0050.00217.59
8.1.90.0050.00217.60
8.1.80.0050.00317.51
8.1.70.0000.00717.48
8.1.60.0030.00617.84
8.1.50.0070.00017.73
8.1.40.0040.00417.59
8.1.30.0000.00817.80
8.1.20.0040.00417.79
8.1.10.0030.00517.82
8.1.00.0030.00517.72
8.0.300.0070.00018.77
8.0.290.0000.00717.43
8.0.280.0000.00718.48
8.0.270.0000.00817.32
8.0.260.0060.00016.93
8.0.250.0030.00317.18
8.0.240.0050.00217.02
8.0.230.0030.00317.06
8.0.220.0000.00717.14
8.0.210.0030.00317.10
8.0.200.0050.00217.16
8.0.190.0080.00017.21
8.0.180.0000.00717.18
8.0.170.0090.00017.12
8.0.160.0070.00017.07
8.0.150.0000.00717.05
8.0.140.0000.00717.02
8.0.130.0030.00313.56
8.0.120.0040.00417.05
8.0.110.0050.00217.04
8.0.100.0000.00717.08
8.0.90.0030.00516.95
8.0.80.0100.00717.03
8.0.70.0050.00217.07
8.0.60.0040.00417.07
8.0.50.0050.00217.01
8.0.30.0090.01417.30
8.0.20.0080.01017.40
8.0.10.0040.00416.94
8.0.00.0100.00816.85
7.4.330.0060.00015.14
7.4.320.0000.00616.87
7.4.300.0030.00316.77
7.4.290.0070.00016.78
7.4.280.0000.00716.61
7.4.270.0030.00316.85
7.4.260.0000.00716.83
7.4.250.0000.00716.88
7.4.240.0020.00516.77
7.4.230.0070.00016.65
7.4.220.0060.00916.76
7.4.210.0060.01116.95
7.4.200.0070.00016.75
7.4.190.0000.00716.66
7.4.160.0140.00316.67
7.4.150.0110.00717.40
7.4.140.0110.01017.86
7.4.130.0090.01116.92
7.4.120.0130.00616.74
7.4.110.0130.00416.93
7.4.100.0120.01216.87
7.4.90.0110.01116.86
7.4.80.0090.00919.39
7.4.70.0060.01516.78
7.4.60.0120.00616.70
7.4.50.0000.00416.48
7.4.40.0040.01122.77
7.4.30.0070.01116.76
7.4.00.0120.00315.17
7.3.330.0050.00013.55
7.3.320.0000.00613.37
7.3.310.0040.00316.54
7.3.300.0080.00016.64
7.3.290.0060.00916.41
7.3.280.0100.01016.50
7.3.270.0090.00917.40
7.3.260.0160.00016.86
7.3.250.0160.00616.76
7.3.240.0080.00816.75
7.3.230.0060.01016.59
7.3.210.0060.01016.58
7.3.200.0130.00319.39
7.3.190.0030.01316.85
7.3.180.0080.00816.58
7.3.170.0060.01016.58
7.3.160.0110.00716.61
7.3.120.0060.00915.04
7.3.10.0070.00816.85
7.3.00.0080.00616.75
7.2.330.0130.00416.91
7.2.320.0120.00916.88
7.2.310.0060.01516.98
7.2.300.0030.02016.88
7.2.290.0120.00616.85
7.2.130.0050.01016.93
7.2.120.0080.00716.87
7.2.110.0090.00517.08
7.2.100.0090.00516.78
7.2.90.0090.00517.05
7.2.80.0110.00917.03
7.2.70.0080.00717.22
7.2.60.0070.00917.02
7.2.50.0050.01216.99
7.2.40.0090.00916.86
7.2.30.0100.01017.03
7.2.20.0100.01117.11
7.2.10.0110.00717.15
7.2.00.0080.00817.62
7.1.250.0080.00715.75
7.1.100.0060.00618.54
7.1.70.0030.00617.34
7.1.60.0040.00817.56
7.1.50.0230.01017.21
7.1.00.0000.07722.34
7.0.200.0080.00316.70
7.0.140.0030.07322.04
7.0.60.0070.08019.98
7.0.50.0000.04317.89
7.0.40.0100.07720.30
7.0.30.0370.05020.28
7.0.20.0330.07320.25
7.0.10.0030.07320.17
7.0.00.0100.07320.34
5.6.280.0100.06721.08
5.6.210.0070.07320.52
5.6.200.0030.07318.22
5.6.190.0030.04320.46
5.6.180.0400.03720.39
5.6.170.0230.03320.54
5.6.160.0170.06020.57
5.6.150.0030.07018.14
5.6.140.0130.07718.14
5.6.130.0130.05718.21
5.6.120.0030.09020.84
5.6.110.0170.07321.00
5.6.100.0070.04321.04
5.6.90.0030.08320.98
5.6.80.0100.07720.58
5.5.350.0230.07720.50
5.5.340.0030.07018.02
5.5.330.0030.04020.42
5.5.320.0300.05020.27
5.5.310.0270.07320.26
5.5.300.0000.05718.08
5.5.290.0000.07317.92
5.5.280.0070.07020.74
5.5.270.0130.07320.76
5.5.260.0100.07720.68
5.5.250.0030.07720.63
5.5.240.0200.07720.18
5.4.450.0470.04719.50
5.4.440.0400.05019.32
5.4.430.0370.04019.55
5.4.420.0530.07319.16
5.4.410.0870.03019.34
5.4.400.0870.04019.09
5.4.390.0870.04018.98
5.4.380.0370.06018.48
5.4.370.0370.05718.77
5.4.360.0400.03718.61
5.4.350.0470.04718.54
5.4.340.0370.06318.73
5.4.320.0050.03712.52
5.4.310.0060.03812.51
5.4.300.0060.04212.52
5.4.290.0060.03812.51
5.4.280.0060.03512.41
5.4.270.0100.06319.22
5.4.260.0230.07718.82
5.4.250.0170.06718.90
5.4.240.0100.06319.09
5.4.230.0100.06718.98
5.4.220.0130.07319.13
5.4.210.0130.05019.13
5.4.200.0170.04719.11
5.4.190.0100.06318.95
5.4.180.0100.07718.84
5.4.170.0100.07018.81
5.4.160.0030.05718.88
5.4.150.0130.07318.91
5.4.140.0070.05716.60
5.4.130.0030.07316.66
5.4.120.0130.06716.68
5.4.110.0100.06716.68
5.4.100.0100.06316.44
5.4.90.0100.06716.48
5.4.80.0100.06316.43
5.4.70.0130.06716.64
5.4.60.0130.06316.46
5.4.50.0070.08016.40
5.4.40.0030.06016.65
5.4.30.0130.05316.62
5.4.20.0200.05016.60
5.4.10.0100.05316.62
5.4.00.0100.04716.16
5.3.290.0040.04012.80
5.3.280.0170.06014.66
5.3.270.0130.05014.84
5.3.260.0200.06714.80
5.3.250.0030.07314.79
5.3.240.0000.06014.79
5.3.230.0200.06014.89
5.3.220.0100.06014.86
5.3.210.0070.06014.87
5.3.200.0130.05314.63
5.3.190.0130.05014.84
5.3.180.0170.06014.60
5.3.170.0200.05714.75
5.3.160.0130.06014.75
5.3.150.0170.05314.75
5.3.140.0100.07014.69
5.3.130.0070.07314.84
5.3.120.0030.06314.84
5.3.110.0130.06014.86
5.3.100.0100.06714.24
5.3.90.0100.05714.08
5.3.80.0170.05313.91
5.3.70.0070.07013.91
5.3.60.0130.06313.89
5.3.50.0130.05314.15
5.3.40.0100.06314.23
5.3.30.0100.07014.13
5.3.20.0030.07313.91
5.3.10.0200.05313.88
5.3.00.0100.06013.91
5.2.170.0070.05011.16
5.2.160.0200.05011.45
5.2.150.0100.05711.42
5.2.140.0100.05711.35
5.2.130.0100.06011.17
5.2.120.0100.05711.40
5.2.110.0070.04311.32
5.2.100.0100.04711.31
5.2.90.0070.05711.32
5.2.80.0030.06011.39
5.2.70.0070.05711.28
5.2.60.0070.06011.28
5.2.50.0130.05011.23
5.2.40.0100.04711.24
5.2.30.0030.05311.25
5.2.20.0200.04011.28
5.2.10.0100.04711.07
5.2.00.0130.05011.04
5.1.60.0070.04010.18
5.1.50.0000.04310.21
5.1.40.0130.03710.04
5.1.30.0030.05310.46
5.1.20.0000.06010.65
5.1.10.0100.04010.03
5.1.00.0030.04710.37
5.0.50.0130.0378.65
5.0.40.0030.0378.41
5.0.30.0030.0778.45
5.0.20.0030.0308.29
5.0.10.0130.0338.34
5.0.00.0070.0478.39
4.4.90.0000.0307.01
4.4.80.0030.0277.01
4.4.70.0070.0307.01
4.4.60.0100.0237.01
4.4.50.0000.0277.01
4.4.40.0030.0377.01
4.4.30.0030.0307.01
4.4.20.0070.0307.01
4.4.10.0030.0337.01
4.4.00.0030.0437.01
4.3.110.0030.0337.01
4.3.100.0100.0237.01
4.3.90.0030.0237.01
4.3.80.0030.0437.01
4.3.70.0070.0207.01
4.3.60.0000.0277.01
4.3.50.0070.0277.01
4.3.40.0030.0407.01
4.3.30.0130.0177.01
4.3.20.0030.0307.01
4.3.10.0000.0237.01
4.3.00.0000.02015.58

preferences:
52.7 ms | 400 KiB | 5 Q