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']; } $formatted_url = rtrim($formatted_url, '/'); var_dump($formatted_url); return $formatted_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.0140.00718.58
8.3.50.0120.00522.17
8.3.40.0120.00318.80
8.3.30.0110.00419.22
8.3.20.0050.00320.30
8.3.10.0040.00422.13
8.3.00.0050.00322.39
8.2.180.0040.01116.50
8.2.170.0190.00022.96
8.2.160.0120.00921.19
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0000.00917.88
8.2.110.0040.00720.40
8.2.100.0040.00818.03
8.2.90.0000.00819.36
8.2.80.0030.00520.02
8.2.70.0050.00317.86
8.2.60.0030.00518.16
8.2.50.0080.00318.07
8.2.40.0050.00318.34
8.2.30.0020.00518.14
8.2.20.0030.00617.85
8.2.10.0040.00419.53
8.2.00.0040.00417.81
8.1.280.0070.00725.92
8.1.270.0080.00022.06
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0130.00324.02
8.1.230.0000.01120.99
8.1.220.0000.00817.91
8.1.210.0080.00018.77
8.1.200.0060.00317.61
8.1.190.0040.00417.65
8.1.180.0030.00618.10
8.1.170.0030.00518.85
8.1.160.0070.00022.02
8.1.150.0000.00718.68
8.1.140.0000.00817.57
8.1.130.0000.00817.85
8.1.120.0000.00717.60
8.1.110.0070.00017.60
8.1.100.0040.00417.59
8.1.90.0030.00517.58
8.1.80.0070.00017.42
8.1.70.0030.00517.52
8.1.60.0030.00617.66
8.1.50.0000.00817.75
8.1.40.0000.00817.76
8.1.30.0040.00417.73
8.1.20.0040.00417.76
8.1.10.0080.00017.77
8.1.00.0050.00317.56
8.0.300.0040.00418.77
8.0.290.0040.00417.29
8.0.280.0050.00318.46
8.0.270.0000.00717.38
8.0.260.0030.00516.89
8.0.250.0030.00317.04
8.0.240.0040.00417.08
8.0.230.0040.00417.11
8.0.220.0030.00317.07
8.0.210.0050.00216.95
8.0.200.0050.00217.11
8.0.190.0040.00417.05
8.0.180.0000.00717.09
8.0.170.0070.00017.10
8.0.160.0000.00717.02
8.0.150.0040.00416.92
8.0.140.0070.00016.93
8.0.130.0060.00013.47
8.0.120.0040.00417.09
8.0.110.0040.00417.05
8.0.100.0070.00016.99
8.0.90.0000.00716.96
8.0.80.0080.00817.01
8.0.70.0040.00416.91
8.0.60.0040.00417.03
8.0.50.0040.00416.90
8.0.30.0060.01417.03
8.0.20.0140.00617.42
8.0.10.0060.00317.16
8.0.00.0090.01217.09
7.4.330.0070.00015.00
7.4.320.0030.00316.68
7.4.300.0080.00016.76
7.4.290.0070.00016.68
7.4.280.0060.00316.74
7.4.270.0000.00716.88
7.4.260.0070.00016.74
7.4.250.0080.00016.71
7.4.240.0050.00216.86
7.4.230.0040.00416.87
7.4.220.0130.01016.82
7.4.210.0060.00816.85
7.4.200.0040.00416.84
7.4.190.0000.00716.73
7.4.160.0100.00716.72
7.4.150.0160.00317.40
7.4.140.0140.00417.86
7.4.130.0070.01616.90
7.4.120.0080.00816.80
7.4.110.0070.01316.57
7.4.100.0160.00316.83
7.4.90.0070.01016.68
7.4.80.0100.01019.39
7.4.70.0140.00416.79
7.4.60.0120.00616.47
7.4.50.0040.00416.78
7.4.40.0030.01222.77
7.4.30.0150.00016.82
7.4.00.0060.00915.37
7.3.330.0050.00013.34
7.3.320.0030.00313.37
7.3.310.0000.00716.52
7.3.300.0030.00316.48
7.3.290.0100.00716.49
7.3.280.0060.01116.47
7.3.270.0110.00717.40
7.3.260.0090.00816.80
7.3.250.0090.00816.80
7.3.240.0130.00316.74
7.3.230.0090.00916.70
7.3.210.0090.01216.79
7.3.200.0090.01319.39
7.3.190.0130.00716.58
7.3.180.0030.01316.79
7.3.170.0070.01416.41
7.3.160.0050.01116.57
7.3.120.0070.00715.04
7.2.330.0030.01317.02
7.2.320.0230.01516.91
7.2.310.0130.00316.97
7.2.300.0110.00516.84
7.2.290.0090.00917.00
7.2.60.0070.00717.13
7.1.200.0070.00416.07
7.1.70.0000.00717.43
7.1.60.0090.01619.82
7.1.50.0060.00616.99
7.1.00.0070.07322.49
7.0.200.0070.00017.09
7.0.140.0000.07322.07
7.0.70.0030.08321.82
7.0.60.0030.08321.71
7.0.50.0030.08022.01
7.0.40.0100.07319.95
7.0.30.0100.07320.14
7.0.20.0070.07720.07
7.0.10.0030.09320.13
7.0.00.0000.05020.18
5.6.280.0070.07020.90
5.6.220.0070.07320.68
5.6.210.0030.05320.77
5.6.200.0030.08721.07
5.6.190.0070.05321.05
5.6.180.0070.07721.04
5.6.170.0030.08321.12
5.6.160.0000.09021.18
5.6.150.0000.06021.08
5.6.140.0100.07721.03
5.6.130.0100.08320.95
5.6.120.0130.07320.97
5.6.110.0030.08721.13
5.6.100.0000.08721.10
5.6.90.0000.08720.94
5.6.80.0030.08020.41
5.6.70.0070.07720.38
5.6.60.0100.06720.33
5.6.50.0000.07320.43
5.6.40.0000.08020.29
5.6.30.0030.07320.32
5.6.20.0030.05720.43
5.6.10.0070.05320.38
5.6.00.0030.08320.37
5.5.360.0100.08320.36
5.5.350.0030.08320.32
5.5.340.0070.07720.87
5.5.330.0000.08020.93
5.5.320.0130.07320.83
5.5.310.0030.08720.84
5.5.300.0000.06020.93
5.5.290.0100.07720.77
5.5.280.0000.09020.88
5.5.270.0100.08020.76
5.5.260.0030.06720.83
5.5.250.0030.08720.70
5.5.240.0070.07720.15
5.5.230.0030.08020.12
5.5.220.0030.07320.18
5.5.210.0100.06320.18
5.5.200.0070.07020.09
5.5.190.0100.07020.23
5.5.180.0070.08020.12
5.5.160.0000.07320.18
5.5.150.0070.07020.16
5.5.140.0070.05720.14
5.5.130.0100.07020.18
5.5.120.0070.06720.13
5.5.110.0100.07320.24
5.5.100.0100.07320.09
5.5.90.0000.08020.08
5.5.80.0000.07320.02
5.5.70.0030.06020.15
5.5.60.0100.06020.09
5.5.50.0070.07020.07
5.5.40.0070.06720.09
5.5.30.0070.06020.10
5.5.20.0100.04719.91
5.5.10.0030.08020.13
5.5.00.0130.07020.00
5.4.450.0030.07319.48
5.4.440.0030.06719.45
5.4.430.0070.07019.22
5.4.420.0100.07319.44
5.4.410.0000.07719.22
5.4.400.0000.07318.87
5.4.390.0000.06719.03
5.4.380.0000.07719.21
5.4.370.0030.08019.18
5.4.360.0070.07019.03
5.4.350.0070.07718.89
5.4.340.0070.06718.96
5.4.320.0000.08318.92
5.4.310.0030.07319.12
5.4.300.0000.07019.08
5.4.290.0030.07719.13
5.4.280.0030.06719.02
5.4.270.0070.07019.15
5.4.260.0070.07319.16
5.4.250.0030.06019.20
5.4.240.0030.07319.02
5.4.230.0100.07019.11
5.4.220.0070.07019.22
5.4.210.0100.06319.15
5.4.200.0100.07319.02
5.4.190.0070.07019.11
5.4.180.0030.07018.89
5.4.170.0000.05019.23
5.4.160.0030.07719.07
5.4.150.0070.07719.19
5.4.140.0000.08016.54
5.4.130.0070.07016.48
5.4.120.0070.07016.29
5.4.110.0070.06716.56
5.4.100.0000.05016.55
5.4.90.0100.05716.39
5.4.80.0070.04016.53
5.4.70.0070.06716.54
5.4.60.0070.06016.48
5.4.50.0070.05316.48
5.4.40.0070.04316.34
5.4.30.0100.06316.43
5.4.20.0000.07716.36
5.4.10.0100.06016.43
5.4.00.0100.06715.68
5.3.290.0030.06714.65
5.3.280.0030.05314.71
5.3.270.0000.08014.64
5.3.260.0030.06714.72
5.3.250.0070.07014.67
5.3.240.0030.07714.57
5.3.230.0030.07314.66
5.3.220.0000.07014.54
5.3.210.0070.05014.69
5.3.200.0030.05014.50
5.3.190.0000.05014.59
5.3.180.0030.07014.56
5.3.170.0000.07014.63
5.3.160.0030.07714.66
5.3.150.0130.04714.60
5.3.140.0030.07714.58
5.3.130.0000.08314.57
5.3.120.0000.07314.53
5.3.110.0070.07314.48
5.3.100.0030.07314.16
5.3.90.0070.04713.98
5.3.80.0030.06713.95
5.3.70.0030.07313.96
5.3.60.0000.07314.15
5.3.50.0070.05313.98
5.3.40.0070.07014.07
5.3.30.0030.07314.00
5.3.20.0070.06713.80
5.3.10.0070.06713.73
5.3.00.0070.07013.57
5.2.170.0030.05711.38
5.2.160.0030.05311.38
5.2.150.0030.06311.38
5.2.140.0000.06311.38
5.2.130.0000.06311.38
5.2.120.0000.06011.38
5.2.110.0030.05011.38
5.2.100.0000.04311.38
5.2.90.0070.03711.38
5.2.80.0000.04711.38
5.2.70.0000.06311.38
5.2.60.0070.06011.38
5.2.50.0030.05011.38
5.2.40.0000.05011.38
5.2.30.0100.05311.38
5.2.20.0030.06311.38
5.2.10.0030.06311.38
5.2.00.0030.05711.38
5.1.60.0100.03711.38
5.1.50.0100.04711.38
5.1.40.0000.05711.38
5.1.30.0030.06011.38
5.1.20.0070.05311.38
5.1.10.0030.03711.38
5.1.00.0000.05711.38
5.0.50.0000.03311.38
5.0.40.0000.04011.38
5.0.30.0000.06711.38
5.0.20.0030.03711.38
5.0.10.0070.04011.38
5.0.00.0000.06711.38
4.4.90.0000.03311.38
4.4.80.0030.02011.38
4.4.70.0000.04011.38
4.4.60.0000.03011.38
4.4.50.0030.03311.38
4.4.40.0000.05311.38
4.4.30.0000.03311.38
4.4.20.0000.03711.38
4.4.10.0000.03311.38
4.4.00.0030.04711.38
4.3.110.0000.03311.38
4.3.100.0030.03011.38
4.3.90.0000.03311.38
4.3.80.0000.04711.38
4.3.70.0000.03311.38
4.3.60.0070.02711.38
4.3.50.0030.03311.38
4.3.40.0000.04711.38
4.3.30.0000.04011.38
4.3.20.0030.03311.38
4.3.10.0000.04011.38
4.3.00.0000.02711.38

preferences:
65.2 ms | 401 KiB | 5 Q