3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace NotGlobal; const PHP_URL_SCHEME = 0x001; const PHP_URL_USER = 0x002; const PHP_URL_PASS = 0x004; const PHP_URL_HOST = 0x008; const PHP_URL_PORT = 0x010; const PHP_URL_PATH = 0x020; const PHP_URL_QUERY = 0x040; const PHP_URL_FRAGMENT = 0x080; const PHP_URL_REQUIRE_SCHEME = 0x100; const PHP_URL_DISALLOW_EMPTY_AUTHORITY = 0x200; function parse_url($url, $flags = 0) { static $map = [ PHP_URL_SCHEME => 'scheme', PHP_URL_USER => 'user', PHP_URL_PASS => 'pass', PHP_URL_HOST => 'host', PHP_URL_PORT => 'port', PHP_URL_PATH => 'path', PHP_URL_QUERY => 'query', PHP_URL_FRAGMENT => 'fragment', ]; static $pattern = '! ^ (?: (?P<scheme> [a-z][a-z0-9+.\-]* ) : )? (?: (?<hasauthority> // ) (?: (?P<user> [^:@/\s]+ ) (?: : (?P<pass> [^:@/\s]+ ) )? @ )? (?P<host> [^:/?#\s]* ) (?: : (?P<port> [0-9]+ ) )? (?= [/?#]|$ ) )? (?P<path> [^?#\s]+ )? (?: \? (?P<query> [^#\s]+ ) )? (?: # (?P<fragment> \S+ ) )? $ !xi'; if (!preg_match($pattern, trim($url), $matches)) { return false; } if ($flags & PHP_URL_REQUIRE_SCHEME) { if (!isset($matches['scheme']) || $matches['scheme'] === '') { return false; } } if ($flags & PHP_URL_DISALLOW_EMPTY_AUTHORITY) { if (isset($matches['hasauthority']) && $matches['hasauthority'] && (!isset($matches['host']) || $matches['host'] === '')) { return false; } } // Default to all components, allowing the above flags // to be specified without specifying the components $flags = $flags & 0xFF ?: 0xFF; $result = []; foreach ($map as $flag => $component) { if (($flags & $flag) && isset($matches[$component]) && $matches[$component] !== '') { $result[$component] = $flag === PHP_URL_PORT ? (int) $matches[$component] : $matches[$component]; } } return count($result) === 1 ? end($result) : $result; } $url = 'http://user:pass@foo.com:123456/test?thing=stuff#fragment'; var_dump(parse_url($url, -1));

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.0130.00318.31
8.3.50.0110.00321.14
8.3.40.0070.00718.92
8.3.30.0100.00320.17
8.3.20.0090.00020.48
8.3.10.0040.00421.08
8.3.00.0040.00422.32
8.2.180.0040.01416.88
8.2.170.0090.00622.96
8.2.160.0080.00620.52
8.2.150.0040.00424.18
8.2.140.0110.00024.66
8.2.130.0080.00026.16
8.2.120.0040.00421.14
8.2.110.0000.01019.10
8.2.100.0090.00317.88
8.2.90.0060.00319.23
8.2.80.0000.00818.04
8.2.70.0060.00317.63
8.2.60.0050.00317.80
8.2.50.0040.00418.07
8.2.40.0050.00318.16
8.2.30.0050.00219.39
8.2.20.0070.00017.74
8.2.10.0040.00417.66
8.2.00.0040.00417.84
8.1.280.0090.00625.92
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00623.77
8.1.230.0060.00621.04
8.1.220.0040.00418.77
8.1.210.0040.00419.12
8.1.200.0070.00417.35
8.1.190.0000.00817.53
8.1.180.0040.00418.10
8.1.170.0080.00018.71
8.1.160.0000.00718.83
8.1.150.0040.00418.66
8.1.140.0000.00817.43
8.1.130.0030.00317.85
8.1.120.0030.00317.45
8.1.110.0030.00617.43
8.1.100.0070.00017.47
8.1.90.0040.00417.39
8.1.80.0020.00517.51
8.1.70.0000.00717.42
8.1.60.0050.00317.62
8.1.50.0000.00717.63
8.1.40.0030.00617.50
8.1.30.0000.00817.61
8.1.20.0030.00517.72
8.1.10.0000.00717.56
8.1.00.0050.00317.33
8.0.300.0040.00420.02
8.0.290.0020.00517.17
8.0.280.0000.00818.35
8.0.270.0040.00417.29
8.0.260.0070.00016.85
8.0.250.0000.00717.04
8.0.240.0040.00416.98
8.0.230.0000.00717.02
8.0.220.0070.00016.89
8.0.210.0030.00316.97
8.0.200.0060.00017.02
8.0.190.0000.00717.02
8.0.180.0040.00416.94
8.0.170.0050.00216.97
8.0.160.0040.00417.00
8.0.150.0040.00416.97
8.0.140.0080.00017.03
8.0.130.0000.00513.44
8.0.120.0040.00416.79
8.0.110.0000.00816.90
8.0.100.0000.00716.86
8.0.90.0000.00716.86
8.0.80.0030.01616.87
8.0.70.0050.00316.87
8.0.60.0040.00416.86
8.0.50.0000.00717.04
8.0.30.0060.01217.25
8.0.20.0080.01717.40
8.0.10.0050.00216.95
8.0.00.0060.01316.85
7.4.330.0050.00016.80
7.4.320.0000.00616.50
7.4.300.0060.00016.65
7.4.290.0030.00316.61
7.4.280.0000.00816.59
7.4.270.0000.00816.70
7.4.260.0050.00013.25
7.4.250.0040.00416.54
7.4.240.0060.00216.69
7.4.230.0070.00016.63
7.4.220.0190.00016.52
7.4.210.0070.00816.69
7.4.200.0000.00716.68
7.4.190.0030.00316.70
7.4.160.0130.00616.50
7.4.150.0060.01417.40
7.4.140.0120.01017.86
7.4.130.0080.01116.69
7.4.120.0080.01316.67
7.4.110.0070.01016.76
7.4.100.0120.01616.68
7.4.90.0160.00316.49
7.4.80.0120.00619.39
7.4.70.0140.00416.69
7.4.60.0140.00516.67
7.4.50.0060.00316.73
7.4.40.0110.00422.77
7.4.30.0060.01216.75
7.4.00.0070.01115.06
7.3.330.0000.00513.23
7.3.320.0000.00513.17
7.3.310.0030.00316.50
7.3.300.0030.00316.27
7.3.290.0100.01016.38
7.3.280.0110.00716.38
7.3.270.0110.00617.40
7.3.260.0120.00818.24
7.3.250.0180.00616.34
7.3.240.0120.00616.36
7.3.230.0030.01316.57
7.3.210.0100.00716.53
7.3.200.0070.01519.39
7.3.190.0000.02116.54
7.3.180.0110.00616.59
7.3.170.0070.01116.55
7.3.160.0030.01316.72
7.3.120.0080.00914.80
7.3.110.0070.01114.74
7.3.100.0090.01214.91
7.3.90.0000.01414.90
7.3.80.0100.00315.00
7.3.70.0060.00314.96
7.3.60.0000.01514.70
7.3.50.0090.00614.98
7.3.40.0090.00014.80
7.3.30.0000.01514.99
7.3.20.0070.00716.75
7.3.10.0130.00316.69
7.3.00.0060.00916.59
7.2.330.0070.01016.79
7.2.320.0070.01516.82
7.2.310.0060.01216.61
7.2.300.0100.01416.90
7.2.290.0060.01016.58
7.2.250.0070.01115.28
7.2.240.0100.01015.10
7.2.230.0100.00315.27
7.2.220.0060.00315.27
7.2.210.0000.01315.16
7.2.200.0030.01115.01
7.2.190.0030.00614.96
7.2.180.0130.00315.01
7.2.170.0090.00315.07
7.1.330.0110.00415.68
7.1.320.0040.00415.83
7.1.310.0030.01015.92
7.1.300.0000.01115.95
7.1.290.0030.00915.94
7.1.280.0070.00715.87
7.1.270.0050.00515.64
7.1.260.0100.00015.71
7.1.70.0030.00716.98
7.1.60.0170.00719.17
7.1.50.0280.01334.47
7.1.00.0030.07022.40
7.0.200.0000.01116.80
7.0.140.0000.07722.10
7.0.100.0130.05020.07
7.0.90.0000.08020.09
7.0.80.0100.03320.02
7.0.70.0200.08019.96
7.0.60.0230.07019.96
7.0.50.0170.05320.37
7.0.40.0030.03720.10
7.0.30.0070.08720.08
7.0.20.0030.08720.09
7.0.10.0200.06320.13
7.0.00.0200.07020.09
5.6.280.0070.07021.04
5.6.250.0130.07320.62
5.6.240.0170.04320.62
5.6.230.0170.04320.64
5.6.220.0070.05020.69
5.6.210.0070.08320.61
5.6.200.0070.08721.05
5.6.190.0100.08021.06
5.6.180.0070.05721.07
5.6.170.0070.07721.06
5.6.160.0070.08721.16
5.6.150.0030.04321.07
5.6.140.0070.03321.19
5.6.130.0100.05321.03
5.6.120.0000.08021.07
5.6.110.0000.08721.07
5.6.100.0070.03321.06
5.6.90.0170.04721.06
5.6.80.0070.03020.54
5.6.70.0070.06020.45
5.6.60.0070.07720.36
5.6.50.0070.08020.44
5.6.40.0000.08320.27
5.6.30.0130.07720.41
5.6.20.0170.06020.38
5.6.10.0170.05720.44
5.6.00.0130.07320.41
5.5.380.0070.06020.56
5.5.370.0070.08720.53
5.5.360.0130.03320.58
5.5.350.0070.08020.46
5.5.340.0200.06720.89
5.5.330.0070.07020.79
5.5.320.0130.07720.90
5.5.310.0030.04020.81
5.5.300.0100.07720.84
5.5.290.0000.04020.90
5.5.280.0200.06320.96
5.5.270.0030.04020.93
5.5.260.0000.08720.89
5.5.250.0070.06720.74
5.5.240.0070.08020.28
5.5.230.0030.06720.31
5.5.220.0130.07320.10
5.5.210.0000.04320.32
5.5.200.0130.07020.14
5.5.190.0070.05320.16
5.5.180.0070.06720.20
5.5.160.0100.08020.29
5.5.150.0130.07020.17
5.5.140.0030.04020.29
5.5.130.0130.03020.24
5.5.120.0070.08320.27
5.5.110.0130.03320.26
5.5.100.0030.04720.07
5.5.90.0070.07019.96
5.5.80.0130.04720.11
5.5.70.0100.07020.08
5.5.60.0030.06720.10
5.5.50.0070.05720.10
5.5.40.0070.03720.04
5.5.30.0030.06320.06
5.5.20.0030.07320.15
5.5.10.0130.04720.03
5.5.00.0130.07019.94
5.4.450.0030.06719.20
5.4.440.0000.07319.23
5.4.430.0100.07319.42
5.4.420.0000.04019.46
5.4.410.0030.03719.09
5.4.400.0030.07018.90
5.4.390.0030.03318.95
5.4.380.0000.08319.05
5.4.370.0030.07719.10
5.4.360.0100.06718.88
5.4.350.0100.07019.13
5.4.340.0070.07718.87
5.4.320.0130.05719.02
5.4.310.0070.07718.95
5.4.300.0100.07019.04
5.4.290.0130.03019.12
5.4.280.0100.03018.89
5.4.270.0000.03719.12
5.4.260.0030.03319.13
5.4.250.0100.03019.22
5.4.240.0100.07319.11
5.4.230.0000.03719.11
5.4.220.0000.03718.89
5.4.210.0070.06318.87
5.4.200.0070.05718.90
5.4.190.0070.03019.08
5.4.180.0000.04019.17
5.4.170.0130.06318.89
5.4.160.0070.07319.02
5.4.150.0000.08019.12
5.4.140.0000.03716.47
5.4.130.0130.02716.30
5.4.120.0170.02316.39
5.4.110.0070.07316.40
5.4.100.0070.05716.56
5.4.90.0070.04016.32
5.4.80.0030.05016.53
5.4.70.0100.05016.46
5.4.60.0130.06016.34
5.4.50.0070.05016.39
5.4.40.0030.07716.45
5.4.30.0070.03316.36
5.4.20.0100.07016.30
5.4.10.0030.03716.47
5.4.00.0030.03315.77
5.3.290.0100.07014.64
5.3.280.0070.05014.61
5.3.270.0030.07314.73
5.3.260.0030.07314.71
5.3.250.0070.07014.65
5.3.240.0000.05714.59
5.3.230.0030.03014.57
5.3.220.0000.07314.68
5.3.210.0100.08314.63
5.3.200.0070.02714.70
5.3.190.0000.04714.70
5.3.180.0130.07014.68
5.3.170.0100.02714.57
5.3.160.0100.07714.64
5.3.150.0030.07714.57
5.3.140.0070.07314.61
5.3.130.0030.07314.66
5.3.120.0000.03714.64
5.3.110.0000.04014.61
5.3.100.0130.02313.99
5.3.90.0030.07714.08
5.3.80.0030.07714.16
5.3.70.0030.03714.05
5.3.60.0100.03014.07
5.3.50.0000.08314.08
5.3.40.0070.03313.88
5.3.30.0030.07313.84
5.3.20.0130.06313.57
5.3.10.0000.04013.69
5.3.00.0030.03313.72
5.2.170.0030.06311.58
5.2.160.0000.03711.58
5.2.150.0070.02711.58
5.2.140.0030.04311.58
5.2.130.0030.05311.58
5.2.120.0000.06711.58
5.2.110.0070.04011.58
5.2.100.0030.05711.58
5.2.90.0000.06711.58
5.2.80.0000.02711.58
5.2.70.0070.05011.58
5.2.60.0030.06311.58
5.2.50.0000.05011.58
5.2.40.0000.02711.58
5.2.30.0070.02011.58
5.2.20.0070.02711.58
5.2.10.0070.04011.58
5.2.00.0000.04011.58
5.1.60.0030.05011.58
5.1.50.0030.04711.58
5.1.40.0000.02711.58
5.1.30.0070.04711.58
5.1.20.0070.05311.58
5.1.10.0000.02311.58
5.1.00.0000.04311.58
5.0.50.0030.03311.58
5.0.40.0000.01711.58
5.0.30.0000.05711.58
5.0.20.0000.01711.58
5.0.10.0030.01311.58
5.0.00.0070.05311.58
4.4.90.0000.01711.58
4.4.80.0030.02711.58
4.4.70.0030.03011.58
4.4.60.0030.02011.58
4.4.50.0000.02011.58
4.4.40.0000.04711.58
4.4.30.0070.01311.58
4.4.20.0030.02311.58
4.4.10.0000.01711.58
4.4.00.0000.03011.58
4.3.110.0000.01311.58
4.3.100.0000.01711.58
4.3.90.0000.02311.58
4.3.80.0000.05311.58
4.3.70.0000.01311.58
4.3.60.0000.03311.58
4.3.50.0000.03011.58
4.3.40.0000.05311.58
4.3.30.0000.02311.58
4.3.20.0000.03711.58
4.3.10.0000.03311.58
4.3.00.0030.02311.58

preferences:
46.42 ms | 401 KiB | 5 Q