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_ALL = 0x0FF; const PHP_URL_REQUIRE_SCHEME = 0x100; const PHP_URL_DISALLOW_EMPTY_AUTHORITY = 0x200; function parse_url($url, $flags = PHP_URL_ALL) { 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 1; } if ($flags & PHP_URL_REQUIRE_SCHEME) { if (!isset($matches['scheme']) || $matches['scheme'] === '') { return 2; } } if ($flags & PHP_URL_DISALLOW_EMPTY_AUTHORITY) { if (isset($matches['hasauthority']) && $matches['hasauthority'] && (!isset($matches['host']) || $matches['host'] === '')) { return 3; } } // Default to all components, allowing the above flags // to be specified without specifying the components $flags = $flags & PHP_URL_ALL ?: PHP_URL_ALL; $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:///test'; var_dump(parse_url($url));

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.00018.81
8.3.50.0120.00821.21
8.3.40.0110.00418.93
8.3.30.0110.00320.30
8.3.20.0080.00020.61
8.3.10.0000.00820.92
8.3.00.0040.00422.34
8.2.180.0160.00316.63
8.2.170.0140.00722.96
8.2.160.0040.01120.43
8.2.150.0040.00424.18
8.2.140.0090.00024.66
8.2.130.0000.00826.16
8.2.120.0030.00521.31
8.2.110.0060.00320.36
8.2.100.0030.00819.83
8.2.90.0080.00018.34
8.2.80.0080.00018.16
8.2.70.0060.00318.00
8.2.60.0040.00417.93
8.2.50.0000.00818.07
8.2.40.0030.00618.16
8.2.30.0000.00719.46
8.2.20.0040.00417.97
8.2.10.0080.00017.94
8.2.00.0040.00417.94
8.1.280.0120.00325.92
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0060.00322.18
8.1.230.0090.00321.05
8.1.220.0060.00317.91
8.1.210.0030.00518.94
8.1.200.0050.00517.60
8.1.190.0050.00317.78
8.1.180.0080.00018.10
8.1.170.0040.00418.52
8.1.160.0000.00719.01
8.1.150.0040.00418.75
8.1.140.0040.00417.64
8.1.130.0000.00717.79
8.1.120.0030.00617.71
8.1.110.0000.00817.59
8.1.100.0040.00417.49
8.1.90.0070.00017.55
8.1.80.0040.00417.54
8.1.70.0030.00317.48
8.1.60.0030.00517.73
8.1.50.0040.00417.77
8.1.40.0040.00417.68
8.1.30.0030.00617.65
8.1.20.0060.00317.74
8.1.10.0000.00917.70
8.1.00.0030.00517.70
8.0.300.0040.00420.16
8.0.290.0040.00417.30
8.0.280.0030.00518.55
8.0.270.0030.00317.20
8.0.260.0070.00017.00
8.0.250.0070.00017.14
8.0.240.0000.00817.16
8.0.230.0040.00417.20
8.0.220.0040.00416.99
8.0.210.0040.00417.04
8.0.200.0030.00317.15
8.0.190.0080.00017.04
8.0.180.0070.00017.08
8.0.170.0000.00717.16
8.0.160.0000.00817.05
8.0.150.0020.00517.01
8.0.140.0040.00416.93
8.0.130.0000.00713.47
8.0.120.0000.00816.98
8.0.110.0040.00416.95
8.0.100.0030.00517.13
8.0.90.0000.00716.94
8.0.80.0060.00917.10
8.0.70.0000.00716.88
8.0.60.0000.00816.94
8.0.50.0030.00516.98
8.0.30.0120.00717.14
8.0.20.0060.01317.40
8.0.10.0080.00017.27
8.0.00.0030.01816.91
7.4.330.0020.00216.88
7.4.320.0000.00616.75
7.4.300.0070.00016.68
7.4.290.0070.00016.79
7.4.280.0070.00016.66
7.4.270.0000.00716.78
7.4.260.0000.00613.54
7.4.250.0040.00416.74
7.4.240.0020.00516.78
7.4.230.0040.00416.96
7.4.220.0120.01316.76
7.4.210.0060.00916.87
7.4.200.0050.00316.76
7.4.190.0040.00416.93
7.4.160.0040.01516.82
7.4.150.0130.01817.40
7.4.140.0100.00817.86
7.4.130.0080.01116.74
7.4.120.0090.00916.78
7.4.110.0060.01116.64
7.4.100.0130.00616.91
7.4.90.0060.01316.59
7.4.80.0080.01219.39
7.4.70.0090.00916.84
7.4.60.0090.00916.80
7.4.50.0000.00716.60
7.4.40.0070.01022.77
7.4.30.0100.01016.84
7.4.10.0030.01315.08
7.4.00.0080.00915.06
7.3.330.0060.00013.51
7.3.320.0000.00613.41
7.3.310.0030.00516.41
7.3.300.0040.00416.58
7.3.290.0070.00716.54
7.3.280.0100.00816.56
7.3.270.0220.00017.40
7.3.260.0090.01118.24
7.3.250.0140.01416.82
7.3.240.0070.01016.53
7.3.230.0080.00816.93
7.3.210.0150.00316.72
7.3.200.0070.01519.39
7.3.190.0140.00616.85
7.3.180.0030.01216.55
7.3.170.0130.00316.89
7.3.160.0100.00616.81
7.3.130.0080.01015.28
7.3.120.0040.00915.27
7.3.110.0130.00714.96
7.3.100.0060.00315.42
7.3.90.0030.01015.32
7.3.80.0040.01115.21
7.3.70.0040.00715.19
7.3.60.0090.00615.18
7.3.50.0000.01014.95
7.3.40.0070.01015.04
7.3.30.0030.00715.16
7.3.20.0110.00416.77
7.3.10.0050.01016.79
7.3.00.0030.01016.87
7.2.330.0100.00716.84
7.2.320.0060.01116.81
7.2.310.0070.01116.70
7.2.300.0070.01016.87
7.2.290.0120.00617.03
7.2.260.0060.00615.26
7.2.250.0030.01615.42
7.2.240.0060.00915.46
7.2.230.0140.00315.19
7.2.220.0030.01014.93
7.2.210.0060.00315.46
7.2.200.0070.01015.43
7.2.190.0000.01315.09
7.2.180.0070.00315.40
7.2.170.0110.00415.45
7.2.160.0000.01315.48
7.2.150.0070.00717.21
7.2.140.0040.00817.28
7.2.130.0080.00816.93
7.2.120.0050.01017.24
7.2.110.0050.00517.02
7.2.100.0070.00617.33
7.2.90.0080.00617.16
7.2.80.0030.01017.11
7.2.70.0020.01217.29
7.2.60.0070.00517.33
7.2.50.0090.00517.13
7.2.40.0050.00717.00
7.2.30.0030.01317.21
7.2.20.0020.01517.35
7.2.10.0040.00617.23
7.2.00.0050.00817.08
7.1.330.0070.01015.82
7.1.320.0000.01216.06
7.1.310.0060.00616.07
7.1.300.0040.00416.04
7.1.290.0000.01416.18
7.1.280.0000.01415.88
7.1.270.0090.00416.17
7.1.260.0080.00816.07
7.1.250.0040.01116.05
7.1.240.0000.01416.03
7.1.230.0080.00615.75
7.1.220.0030.00916.17
7.1.210.0130.00016.07
7.1.200.0090.00616.09
7.1.190.0030.00815.98
7.1.180.0070.00415.98
7.1.170.0070.00716.12
7.1.160.0040.00816.09
7.1.150.0070.00716.19
7.1.140.0070.00416.09
7.1.130.0060.00915.80
7.1.120.0000.00915.94
7.1.110.0120.00316.03
7.1.100.0140.00416.01
7.1.90.0030.00915.99
7.1.80.0070.00715.96
7.1.70.0080.00516.52
7.1.60.0060.01317.46
7.1.50.0110.01625.46
7.1.40.0030.00615.98
7.1.30.0040.00716.00
7.1.20.0070.00716.03
7.1.10.0000.01115.72
7.1.00.0060.02119.14
7.0.330.0040.00415.84
7.0.320.0000.01515.68
7.0.310.0080.00615.64
7.0.300.0000.00815.37
7.0.290.0080.00415.71
7.0.280.0040.01115.80
7.0.270.0110.00415.73
7.0.260.0060.01015.34
7.0.250.0100.00315.54
7.0.240.0000.01215.42
7.0.230.0040.00415.61
7.0.220.0100.00315.80
7.0.210.0030.00615.76
7.0.200.0040.00716.05
7.0.190.0000.01615.76
7.0.180.0060.00615.63
7.0.170.0030.00615.52
7.0.160.0130.00015.72
7.0.150.0070.01015.61
7.0.140.0020.04318.89
7.0.130.0100.00315.63
7.0.120.0100.00315.72
7.0.110.0140.00315.67
7.0.100.0290.04217.89
7.0.90.0250.04917.91
7.0.80.0190.03617.71
7.0.70.0270.04017.76
7.0.60.0230.04317.72
7.0.50.0250.04317.98
7.0.40.0050.04616.94
7.0.30.0060.04416.93
7.0.20.0110.03616.90
7.0.10.0070.04216.86
7.0.00.0150.03716.90
5.6.400.0040.00814.71
5.6.390.0050.00514.72
5.6.380.0030.00614.75
5.6.370.0040.00414.68
5.6.360.0000.00814.45
5.6.350.0030.01014.32
5.6.340.0070.01014.91
5.6.330.0030.00914.79
5.6.320.0060.00614.71
5.6.310.0000.01414.25
5.6.300.0100.00614.56
5.6.290.0080.01214.81
5.6.280.0050.03817.92
5.6.270.0110.00414.63
5.6.260.0090.00614.66
5.6.250.0080.03817.69
5.6.240.0120.04217.55
5.6.230.0050.04517.62
5.6.220.0070.02717.59
5.6.210.0090.04217.52
5.6.200.0100.04317.91
5.6.190.0100.03817.83
5.6.180.0120.04217.91
5.6.170.0110.02617.90
5.6.160.0070.04417.83
5.6.150.0050.04517.74
5.6.140.0080.03517.69
5.6.130.0100.02817.68
5.6.120.0060.02317.75
5.6.110.0070.02317.72
5.6.100.0050.02617.74
5.6.90.0090.02017.93
5.6.80.0070.03717.43
5.6.70.0020.03317.45
5.6.60.0050.02717.57
5.6.50.0050.02917.50
5.6.40.0050.02317.42
5.6.30.0050.02317.58
5.6.20.0070.02017.46
5.6.10.0000.03117.50
5.6.00.0050.02517.48
5.5.380.0030.04317.48
5.5.370.0140.03517.41
5.5.360.0120.04017.40
5.5.350.0070.04517.63
5.5.340.0080.04217.71
5.5.330.0080.04617.58
5.5.320.0050.03817.67
5.5.310.0100.03517.60
5.5.300.0060.03117.65
5.5.290.0100.04417.74
5.5.280.0000.02917.53
5.5.270.0070.02217.68
5.5.260.0130.01517.74
5.5.250.0040.02317.55
5.5.240.0060.02017.36
5.5.230.0020.03317.29
5.5.220.0020.02617.40
5.5.210.0080.01717.32
5.5.200.0060.02617.38
5.5.190.0070.02217.31
5.5.180.0080.03217.35
5.5.170.0030.01214.65
5.5.160.0080.02117.35
5.5.150.0030.02817.33
5.5.140.0050.03417.38
5.5.130.0070.02817.26
5.5.120.0050.02117.23
5.5.110.0090.02417.46
5.5.100.0030.02817.31
5.5.90.0030.03017.21
5.5.80.0070.03217.24
5.5.70.0080.01817.19
5.5.60.0060.02517.07
5.5.50.0030.02517.07
5.5.40.0080.01917.29
5.5.30.0110.02317.33
5.5.20.0050.02317.28
5.5.10.0030.04517.25
5.5.00.0050.03417.31
5.4.450.0090.03315.27
5.4.440.0030.02115.36
5.4.430.0030.02515.27
5.4.420.0040.02115.31
5.4.410.0000.02415.36
5.4.400.0050.02115.11
5.4.390.0070.04015.20
5.4.380.0030.02215.07
5.4.370.0050.01915.16
5.4.360.0050.02015.15
5.4.350.0040.02015.34
5.4.340.0060.01815.10
5.4.330.0040.01110.80
5.4.320.0060.02115.07
5.4.310.0070.01715.23
5.4.300.0000.02515.11
5.4.290.0100.01515.09
5.4.280.0050.02115.07
5.4.270.0030.02515.26
5.4.260.0000.02515.09
5.4.250.0060.01815.16
5.4.240.0060.02115.23
5.4.230.0020.02314.89
5.4.220.0030.02415.04
5.4.210.0050.03715.17
5.4.200.0050.04015.11
5.4.190.0010.02315.14
5.4.180.0040.03615.08
5.4.170.0060.04015.21
5.4.160.0030.02315.05
5.4.150.0100.03315.30
5.4.140.0060.04013.99
5.4.130.0070.04013.84
5.4.120.0030.04213.90
5.4.110.0070.03713.81
5.4.100.0070.04013.95
5.4.90.0020.02913.66
5.4.80.0100.03213.82
5.4.70.0020.04513.72
5.4.60.0090.03813.75
5.4.50.0070.03913.75
5.4.40.0070.04213.85
5.4.30.0100.03513.81
5.4.20.0050.02813.88
5.4.10.0070.03513.72
5.4.00.0090.03213.54
5.3.290.0040.03612.50
5.3.280.0000.04112.46
5.3.270.0100.03312.42
5.3.260.0070.03312.47
5.3.250.0090.01912.46
5.3.240.0070.03912.44
5.3.230.0080.04212.44
5.3.220.0030.03512.42
5.3.210.0050.03312.40
5.3.200.0060.03712.48
5.3.190.0110.03712.41
5.3.180.0090.03512.46
5.3.170.0030.04212.53
5.3.160.0080.02012.39
5.3.150.0050.04212.45
5.3.140.0050.03712.46
5.3.130.0120.03512.46
5.3.120.0030.02812.40
5.3.110.0000.04512.40
5.3.100.0060.03412.15
5.3.90.0080.02112.28
5.3.80.0050.03812.19
5.3.70.0050.04212.13
5.3.60.0050.03812.23
5.3.50.0050.03912.06
5.3.40.0070.03312.08
5.3.30.0030.04312.18
5.3.20.0050.04112.07
5.3.10.0080.03811.94
5.3.00.0070.01812.00
5.2.170.0000.06711.96
5.2.160.0070.06011.96
5.2.150.0030.04311.96
5.2.140.0030.06311.96
5.2.130.0070.06311.96
5.2.120.0130.05011.96
5.2.110.0000.03711.96
5.2.100.0030.06011.96
5.2.90.0030.06311.96
5.2.80.0100.06011.96
5.2.70.0070.06311.96
5.2.60.0070.06011.96
5.2.50.0070.05311.96
5.2.40.0030.04011.96
5.2.30.0130.05011.96
5.2.20.0070.03011.96
5.2.10.0070.05311.96
5.2.00.0030.05711.96
5.1.60.0000.05711.96
5.1.50.0100.05011.96
5.1.40.0070.05311.96
5.1.30.0100.04711.96
5.1.20.0100.02711.96
5.1.10.0070.05011.96
5.1.00.0030.05311.96
5.0.50.0000.04711.96
5.0.40.0100.03311.96
5.0.30.0030.05311.96
5.0.20.0000.04011.96
5.0.10.0000.04711.96
5.0.00.0000.05311.96
4.4.90.0070.03311.96
4.4.80.0070.01711.96
4.4.70.0000.02011.96
4.4.60.0030.03311.96
4.4.50.0070.02011.96
4.4.40.0030.05011.96
4.4.30.0070.03011.96
4.4.20.0130.02311.96
4.4.10.0000.03711.96
4.4.00.0100.04311.96
4.3.110.0070.03011.96
4.3.100.0000.03711.96
4.3.90.0030.02711.96
4.3.80.0030.05711.96
4.3.70.0000.03711.96
4.3.60.0030.03311.96
4.3.50.0030.03311.96
4.3.40.0000.05011.96
4.3.30.0000.02011.96
4.3.20.0000.02011.96
4.3.10.0000.04011.96
4.3.00.0000.03311.96

preferences:
49.44 ms | 401 KiB | 5 Q