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 = 'http://seos.bolseo.ru/index.php?module=2&siteID=235'; $url_2 = 'ftps://seos.bolseo.ru/?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.0160.00318.43
8.3.50.0060.01522.18
8.3.40.0070.01019.13
8.3.30.0170.00319.09
8.3.20.0080.00020.30
8.3.10.0080.00021.92
8.3.00.0060.00322.52
8.2.180.0130.01016.88
8.2.170.0070.00722.96
8.2.160.0110.00321.24
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0090.00626.16
8.2.120.0040.00419.50
8.2.110.0070.00320.94
8.2.100.0090.00317.91
8.2.90.0090.00017.75
8.2.80.0080.00018.04
8.2.70.0040.00417.80
8.2.60.0000.00818.04
8.2.50.0040.00418.10
8.2.40.0040.00420.46
8.2.30.0000.00718.30
8.2.20.0040.00417.93
8.2.10.0080.00017.82
8.2.00.0040.00417.94
8.1.280.0060.00925.92
8.1.270.0050.00322.11
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00022.17
8.1.230.0100.00322.75
8.1.220.0030.00617.89
8.1.210.0030.00518.77
8.1.200.0030.00617.60
8.1.190.0000.00817.50
8.1.180.0000.00818.10
8.1.170.0000.00818.84
8.1.160.0000.00721.89
8.1.150.0080.00018.81
8.1.140.0000.00817.59
8.1.130.0000.00817.82
8.1.120.0070.00017.60
8.1.110.0000.00817.61
8.1.100.0040.00417.50
8.1.90.0030.00517.54
8.1.80.0040.00417.58
8.1.70.0030.00317.55
8.1.60.0030.00617.73
8.1.50.0040.00417.76
8.1.40.0040.00417.61
8.1.30.0000.00817.80
8.1.20.0030.00517.85
8.1.10.0040.00417.80
8.1.00.0050.00317.75
8.0.300.0040.00421.94
8.0.290.0000.00716.88
8.0.280.0000.00718.59
8.0.270.0000.00717.37
8.0.260.0070.00017.07
8.0.250.0070.00017.12
8.0.240.0050.00317.04
8.0.230.0000.00817.19
8.0.220.0000.00817.11
8.0.210.0070.00016.98
8.0.200.0070.00017.00
8.0.190.0080.00017.05
8.0.180.0030.00617.13
8.0.170.0040.00417.02
8.0.160.0000.00717.02
8.0.150.0040.00416.99
8.0.140.0000.00716.95
8.0.130.0060.00013.48
8.0.120.0040.00417.01
8.0.110.0040.00416.97
8.0.100.0070.00016.96
8.0.90.0000.00817.09
8.0.80.0150.00317.04
8.0.70.0090.00017.09
8.0.60.0000.00816.91
8.0.50.0040.00416.95
8.0.30.0140.00917.21
8.0.20.0160.00317.44
8.0.10.0030.00516.99
8.0.00.0160.00716.90
7.4.330.0040.00215.00
7.4.320.0060.00016.77
7.4.300.0000.00616.92
7.4.290.0040.00416.68
7.4.280.0030.00316.62
7.4.270.0030.00316.91
7.4.260.0000.00716.70
7.4.250.0000.00816.71
7.4.240.0040.00316.75
7.4.230.0000.00616.77
7.4.220.0030.01216.63
7.4.210.0080.00916.84
7.4.200.0000.00716.77
7.4.190.0070.00016.90
7.4.160.0080.00816.79
7.4.150.0110.00817.40
7.4.140.0080.01017.86
7.4.130.0070.01116.80
7.4.120.0130.00816.84
7.4.110.0110.00616.89
7.4.100.0140.00716.81
7.4.90.0090.00916.66
7.4.80.0110.00819.39
7.4.70.0080.00916.75
7.4.60.0090.00716.68
7.4.50.0000.00816.76
7.4.40.0120.00822.77
7.4.30.0130.00316.66
7.4.00.0030.00715.35
7.3.330.0020.00213.52
7.3.320.0060.00013.56
7.3.310.0070.00016.52
7.3.300.0000.00716.57
7.3.290.0140.00716.46
7.3.280.0060.01116.50
7.3.270.0150.00317.40
7.3.260.0060.01116.82
7.3.250.0130.00616.63
7.3.240.0080.00816.62
7.3.230.0030.01416.87
7.3.210.0100.00716.52
7.3.200.0100.01019.39
7.3.190.0100.01316.84
7.3.180.0000.01616.59
7.3.170.0060.00916.52
7.3.160.0100.00716.71
7.3.120.0000.01515.29
7.2.330.0100.00816.89
7.2.320.0070.01016.94
7.2.310.0120.00616.77
7.2.300.0070.01416.92
7.2.290.0090.00917.07
7.2.60.0040.01117.13
7.2.00.0030.01319.78
7.1.200.0070.00415.75
7.1.100.0060.00918.52
7.1.70.0040.00717.14
7.1.60.0030.02219.82
7.1.50.0060.00917.23
7.1.00.0070.07322.43
7.0.200.0060.00616.94
7.0.140.0000.07722.08
7.0.60.0070.08320.05
7.0.50.0030.04017.91
7.0.40.0130.06320.24
7.0.30.0270.05720.08
7.0.20.0330.05320.15
7.0.10.0370.07320.09
7.0.00.0070.08020.07
5.6.280.0100.06720.88
5.6.210.0200.07320.52
5.6.200.0000.04718.22
5.6.190.0130.07720.46
5.6.180.3400.04720.48
5.6.170.0130.05720.55
5.6.160.0070.04020.47
5.6.150.0030.08718.13
5.6.140.0070.08018.18
5.6.130.0100.07318.15
5.6.120.0030.08721.14
5.6.110.0100.07321.04
5.6.100.0000.04720.90
5.6.90.0200.07320.99
5.6.80.0170.07720.30
5.6.70.0200.04020.45
5.5.350.0030.08320.34
5.5.340.0030.05317.93
5.5.330.0100.08320.41
5.5.320.0230.08020.31
5.5.310.0400.05020.27
5.5.300.0070.07017.95
5.5.290.0030.04317.98
5.5.280.0100.05020.90
5.5.270.0030.04720.88
5.5.260.0100.06720.68
5.5.250.0070.05720.72
5.5.240.0170.07720.27
5.4.450.0500.06019.32
5.4.440.0700.05319.55
5.4.430.0070.07719.32
5.4.420.0070.07319.36
5.4.410.0000.06719.21
5.4.400.0100.05018.62
5.4.390.0070.05318.79
5.4.380.0300.04718.84
5.4.370.0370.05018.69
5.4.360.0300.04718.76
5.4.350.0130.06018.71
5.4.340.0130.05718.61
5.4.320.0090.03812.52
5.4.310.0080.03612.52
5.4.300.0090.03812.52
5.4.290.0080.05312.51
5.4.280.0060.03712.41
5.4.270.0070.06319.04
5.4.260.0070.07018.92
5.4.250.0070.05719.02
5.4.240.0170.07319.00
5.4.230.0200.07319.02
5.4.220.0070.05719.14
5.4.210.0100.05719.02
5.4.200.0100.05019.20
5.4.190.0070.05318.91
5.4.180.0100.05019.00
5.4.170.0130.07018.83
5.4.160.0130.06018.93
5.4.150.0130.05718.93
5.4.140.0100.05716.71
5.4.130.0230.06316.65
5.4.120.0100.06016.64
5.4.110.0030.08316.66
5.4.100.0070.05316.66
5.4.90.0170.04316.68
5.4.80.0130.04716.71
5.4.70.0000.07316.46
5.4.60.0330.06716.46
5.4.50.0170.04716.62
5.4.40.0100.06316.57
5.4.30.0070.06316.38
5.4.20.0030.05316.40
5.4.10.0100.07316.65
5.4.00.0070.05316.09
5.3.290.0090.04212.80
5.3.280.0170.04314.73
5.3.270.0100.05714.93
5.3.260.0100.05014.81
5.3.250.0170.06714.90
5.3.240.0170.04714.89
5.3.230.0100.05714.67
5.3.220.0030.05714.77
5.3.210.0030.08014.77
5.3.200.0200.04314.84
5.3.190.0070.05714.75
5.3.180.0070.05314.63
5.3.170.0100.06714.87
5.3.160.0170.05314.88
5.3.150.0100.05314.83
5.3.140.0130.07314.56
5.3.130.0100.07714.82
5.3.120.0170.04714.87
5.3.110.0070.05714.86
5.3.100.0070.05714.24
5.3.90.0130.06313.99
5.3.80.0070.06314.09
5.3.70.0070.06314.21
5.3.60.0170.05014.22
5.3.50.0130.06314.01
5.3.40.0100.05314.09
5.3.30.0100.05314.04
5.3.20.0070.05013.76
5.3.10.0070.05013.54
5.3.00.0100.06013.86
5.2.170.0030.05711.36
5.2.160.0070.04311.21
5.2.150.0000.04711.16
5.2.140.0100.04011.36
5.2.130.0070.06711.40
5.2.120.0130.03311.43
5.2.110.0130.04711.41
5.2.100.0030.04711.41
5.2.90.0030.06711.11
5.2.80.0070.04311.40
5.2.70.0070.05711.39
5.2.60.0130.04311.25
5.2.50.0070.04011.09
5.2.40.0130.05011.21
5.2.30.0100.04011.00
5.2.20.0170.03311.09
5.2.10.0170.04311.14
5.2.00.0100.03711.02
5.1.60.0030.04010.11
5.1.50.0070.03310.07
5.1.40.0100.0339.97
5.1.30.0070.04010.54
5.1.20.0100.04010.56
5.1.10.0100.03710.40
5.1.00.0030.04010.31
5.0.50.0030.0338.86
5.0.40.0200.0278.42
5.0.30.0030.0438.24
5.0.20.0000.0378.19
5.0.10.0130.0278.45
5.0.00.0100.0408.46
4.4.90.0000.0276.70
4.4.80.0000.0236.70
4.4.70.0000.0306.70
4.4.60.0100.0236.70
4.4.50.0070.0276.70
4.4.40.0000.0376.70
4.4.30.0030.0236.70
4.4.20.0030.0276.70
4.4.10.0100.0176.70
4.4.00.0100.0306.70
4.3.110.0100.0236.70
4.3.100.0030.0236.70
4.3.90.0070.0176.70
4.3.80.0030.0436.70
4.3.70.0000.0306.70
4.3.60.0000.0236.70
4.3.50.0070.0176.70
4.3.40.0030.0336.70
4.3.30.0000.0236.70
4.3.20.0030.0206.70
4.3.10.0000.0306.70
4.3.00.0030.0237.02

preferences:
45.05 ms | 400 KiB | 5 Q