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 = <<<EXPR ! ^ (?: (?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 EXPR; 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://foo:123454#fooo'; 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.0040.01518.55
8.3.50.0090.00922.09
8.3.40.0110.00418.83
8.3.30.0140.00019.17
8.3.20.0080.00020.21
8.3.10.0080.00023.71
8.3.00.0040.00421.02
8.2.180.0130.00716.63
8.2.170.0070.00722.96
8.2.160.0030.01220.47
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0000.00826.16
8.2.120.0000.00819.61
8.2.110.0040.00422.29
8.2.100.0040.00720.35
8.2.90.0060.00319.26
8.2.80.0050.00317.97
8.2.70.0030.00717.88
8.2.60.0060.00318.04
8.2.50.0060.00318.07
8.2.40.0040.00418.28
8.2.30.0000.00818.30
8.2.20.0080.00017.99
8.2.10.0030.00518.25
8.2.00.0040.00418.02
8.1.280.0120.00325.92
8.1.270.0060.00324.11
8.1.260.0040.00426.35
8.1.250.0030.00528.09
8.1.240.0100.00023.96
8.1.230.0030.00919.23
8.1.220.0050.00317.79
8.1.210.0050.00318.77
8.1.200.0030.00717.60
8.1.190.0060.00317.38
8.1.180.0040.00418.10
8.1.170.0000.00918.84
8.1.160.0000.00822.08
8.1.150.0000.00818.84
8.1.140.0030.00617.56
8.1.130.0050.00219.54
8.1.120.0040.00417.69
8.1.110.0000.00817.48
8.1.100.0050.00217.65
8.1.90.0080.00017.70
8.1.80.0030.00517.67
8.1.70.0040.00417.51
8.1.60.0030.00517.64
8.1.50.0050.00317.64
8.1.40.0040.00417.59
8.1.30.0090.00017.80
8.1.20.0030.00517.74
8.1.10.0000.00917.77
8.1.00.0000.00917.62
8.0.300.0000.00818.77
8.0.290.0080.00017.00
8.0.280.0030.00318.43
8.0.270.0070.00017.32
8.0.260.0030.00317.32
8.0.250.0030.00317.23
8.0.240.0000.00917.26
8.0.230.0050.00317.20
8.0.220.0000.00717.16
8.0.210.0030.00317.16
8.0.200.0030.00717.27
8.0.190.0030.00517.19
8.0.180.0020.00517.20
8.0.170.0030.00617.03
8.0.160.0030.00317.09
8.0.150.0080.00417.08
8.0.140.0050.00317.10
8.0.130.0000.00613.66
8.0.120.0000.00817.10
8.0.110.0040.00417.14
8.0.100.0040.00417.18
8.0.90.0040.00417.21
8.0.80.0090.00617.16
8.0.70.0080.00017.26
8.0.60.0040.00416.99
8.0.50.0000.00817.18
8.0.30.0120.00817.23
8.0.20.0130.00717.47
8.0.10.0040.00417.05
8.0.00.0060.01617.07
7.4.330.0020.00315.01
7.4.320.0030.00316.89
7.4.300.0000.00716.75
7.4.290.0040.00416.68
7.4.280.0040.00416.76
7.4.270.0040.00416.77
7.4.260.0000.00716.85
7.4.250.0080.00016.83
7.4.240.0020.00516.84
7.4.230.0040.00416.74
7.4.220.0150.00316.75
7.4.210.0040.01016.96
7.4.200.0000.00816.96
7.4.160.0150.00716.73
7.4.150.0160.00317.40
7.4.140.0100.00817.86
7.4.130.0090.00916.71
7.4.120.0040.01316.70
7.4.110.0090.00916.92
7.4.100.0070.01016.77
7.4.90.0040.01316.71
7.4.80.0220.00319.39
7.4.70.0110.00616.96
7.4.60.0100.00916.68
7.4.50.0000.00916.77
7.4.40.0110.00816.58
7.4.30.0060.00916.80
7.4.10.0080.01115.11
7.4.00.0050.01215.16
7.3.330.0050.00013.44
7.3.320.0060.00013.62
7.3.310.0020.00516.61
7.3.300.0030.00316.50
7.3.290.0000.01516.63
7.3.280.0050.01216.63
7.3.270.0080.01217.40
7.3.260.0130.01316.66
7.3.250.0080.01216.81
7.3.240.0110.00616.69
7.3.230.0190.00516.54
7.3.210.0090.00916.82
7.3.200.0110.00619.39
7.3.190.0180.00716.79
7.3.180.0070.01116.77
7.3.170.0100.00716.77
7.3.160.0080.00916.64
7.3.130.0060.01215.14
7.3.120.0100.00615.05
7.3.110.0130.00314.92
7.3.100.0060.00914.90
7.3.90.0060.01015.32
7.3.80.0070.00415.26
7.3.70.0110.00314.96
7.3.60.0000.00914.91
7.3.50.0030.01014.80
7.3.40.0030.00914.72
7.3.30.0040.00815.21
7.3.20.0100.00716.98
7.3.10.0000.01216.95
7.3.00.0030.01417.18
7.2.330.0090.00917.05
7.2.320.0060.01616.79
7.2.310.0070.01116.90
7.2.300.0100.00616.94
7.2.290.0930.01116.91
7.2.260.0030.01315.28
7.2.250.0110.00415.52
7.2.240.0090.00615.06
7.2.230.0000.01415.45
7.2.220.0000.01615.10
7.2.210.0070.00715.04
7.2.200.0060.01215.46
7.2.190.0030.00715.33
7.2.180.0030.00615.28
7.2.170.0060.00615.33
7.2.160.0110.00415.28
7.2.150.0060.00617.31
7.2.140.0060.00916.94
7.2.130.0100.00317.11
7.2.120.0060.00917.12
7.2.110.0070.00717.06
7.2.100.0060.00917.15
7.2.90.0060.01317.13
7.2.80.0090.00917.21
7.2.70.0000.01817.37
7.2.60.0070.00716.83
7.2.50.0040.01217.26
7.2.40.0100.00717.03
7.2.30.0030.01217.29
7.2.20.0110.00417.26
7.2.10.0070.01017.14
7.2.00.0030.01317.21
7.1.330.0110.00415.82
7.1.320.0030.00615.71
7.1.310.0000.01215.89
7.1.300.0040.00816.23
7.1.290.0070.00716.06
7.1.280.0070.00716.13
7.1.270.0030.01016.19
7.1.260.0040.01116.16
7.1.250.0000.01316.13
7.1.240.0000.01116.08
7.1.230.0030.01016.02
7.1.220.0000.01016.09
7.1.210.0030.01415.75
7.1.200.0050.01215.84
7.1.190.0000.01515.84
7.1.180.0060.00615.84
7.1.170.0040.00815.93
7.1.160.0080.01215.77
7.1.150.0060.00615.99
7.1.140.0090.00915.90
7.1.130.0040.01415.94
7.1.120.0060.00916.07
7.1.110.0030.01016.21
7.1.100.0000.01715.96
7.1.90.0030.01016.14
7.1.80.0060.00315.98
7.1.70.0110.00016.77
7.1.60.0070.01017.85
7.1.50.0040.01516.57
7.1.40.0100.00616.26
7.1.30.0070.01116.04
7.1.20.0040.00715.67
7.1.10.0000.01016.06
7.1.00.0050.04419.28
7.0.330.0060.00615.63
7.0.320.0030.01215.68
7.0.310.0030.01415.32
7.0.300.0000.02015.65
7.0.290.0060.01215.45
7.0.280.0070.00415.53
7.0.270.0040.01415.59
7.0.260.0000.00915.49
7.0.250.0090.00315.71
7.0.240.0030.00615.32
7.0.230.0060.00715.75
7.0.220.0040.00715.57
7.0.210.0040.00815.87
7.0.200.0000.00816.29
7.0.190.0040.01115.54
7.0.180.0030.01015.55
7.0.170.0090.00615.65
7.0.160.0060.00315.65
7.0.150.0060.00615.80
7.0.140.0050.04118.90
7.0.130.0040.00715.77
7.0.120.0040.00815.76
7.0.110.0080.00415.77
7.0.100.0070.00715.46
7.0.90.0090.00015.50
7.0.80.0190.02417.86
7.0.70.0180.02517.76
7.0.60.0180.02317.80
7.0.50.0200.02418.02
7.0.40.0030.02516.85
7.0.30.0020.02916.87
7.0.20.0080.04616.93
7.0.10.0050.03516.88
7.0.00.0100.04416.87
5.6.400.0040.01114.80
5.6.390.0030.00614.59
5.6.380.0030.00614.44
5.6.370.0070.01314.85
5.6.360.0060.01014.67
5.6.350.0030.01614.66
5.6.340.0040.00814.92
5.6.330.0070.01014.45
5.6.320.0100.00314.37
5.6.310.0030.01014.34
5.6.300.0070.00714.57
5.6.290.0090.00914.23
5.6.280.0050.04017.64
5.6.270.0070.00714.57
5.6.260.0040.00714.66
5.6.250.0000.01414.68
5.6.240.0030.01014.75
5.6.230.0020.02617.66
5.6.220.0030.03317.53
5.6.210.0050.02517.65
5.6.200.0020.02617.82
5.6.190.0090.02217.86
5.6.180.0030.02917.78
5.6.170.0050.03517.75
5.6.160.0120.03817.75
5.6.150.0100.03017.80
5.6.140.0080.03217.93
5.6.130.0120.04417.67
5.6.120.0050.04317.78
5.6.110.0130.03617.93
5.6.100.0080.04217.78
5.6.90.0080.04417.77
5.6.80.0070.04517.58
5.6.70.0060.03917.32
5.6.60.0110.02817.35
5.6.50.0130.02517.44
5.6.40.0050.04517.59
5.6.30.0080.03817.35
5.6.20.0090.03317.37
5.6.10.0130.03117.48
5.6.00.0060.04317.54
5.5.380.0030.01214.48
5.5.370.0070.02017.47
5.5.360.0050.02717.54
5.5.350.0040.02917.62
5.5.340.0030.04517.70
5.5.330.0060.02417.70
5.5.320.0040.02717.79
5.5.310.0030.04517.65
5.5.300.0130.03617.60
5.5.290.0050.04717.63
5.5.280.0050.03217.74
5.5.270.0060.04917.69
5.5.260.0050.04817.66
5.5.250.0180.03517.49
5.5.240.0060.03417.48
5.5.230.0050.02917.31
5.5.220.0050.03417.37
5.5.210.0070.04317.27
5.5.200.0110.02917.33
5.5.190.0070.03817.24
5.5.180.0030.05017.23
5.5.170.0030.01314.52
5.5.160.0050.02617.22
5.5.150.0080.03717.29
5.5.140.0080.04117.44
5.5.130.0090.03917.27
5.5.120.0030.04417.19
5.5.110.0050.04517.28
5.5.100.0090.02717.23
5.5.90.0100.04017.18
5.5.80.0000.04417.16
5.5.70.0030.03717.28
5.5.60.0070.03917.21
5.5.50.0080.03917.19
5.5.40.0120.03817.27
5.5.30.0130.03217.36
5.5.20.0070.04417.25
5.5.10.0070.02617.15
5.5.00.0050.03117.32
5.4.450.0030.04515.46
5.4.440.0140.03815.40
5.4.430.0070.03915.47
5.4.420.0060.04015.37
5.4.410.0050.04215.37
5.4.400.0050.04615.15
5.4.390.0060.02815.07
5.4.380.0070.03415.13
5.4.370.0080.03915.08
5.4.360.0050.04615.03
5.4.350.0070.04015.21
5.4.340.0110.03915.21
5.4.330.0070.00411.30
5.4.320.0120.02114.91
5.4.310.0050.04215.22
5.4.300.0030.03015.23
5.4.290.0050.03815.21
5.4.280.0030.04215.22
5.4.270.0050.04215.07
5.4.260.0050.03315.06
5.4.250.0090.03615.23
5.4.240.0050.04115.18
5.4.230.0010.04414.99
5.4.220.0070.02115.24
5.4.210.0140.03015.06
5.4.200.0070.03715.07
5.4.190.0070.03715.14
5.4.180.0030.02815.24
5.4.170.0020.03214.93
5.4.160.0080.03815.09
5.4.150.0030.04615.02
5.4.140.0000.04313.72
5.4.130.0030.04513.72
5.4.120.0070.03713.90
5.4.110.0020.04113.73
5.4.100.0040.04213.82
5.4.90.0050.03613.96
5.4.80.0030.04013.70
5.4.70.0080.03713.66
5.4.60.0070.03013.74
5.4.50.0070.03513.77
5.4.40.0080.03913.79
5.4.30.0030.04213.79
5.4.20.0080.03713.76
5.4.10.0070.04013.79
5.4.00.0100.03713.66
5.3.290.0020.03712.78
5.3.280.0080.02312.66
5.3.270.0050.02312.65
5.3.260.0050.04112.75
5.3.250.0030.04412.66
5.3.240.0050.02312.73
5.3.230.0140.03712.71
5.3.220.0070.03712.72
5.3.210.0050.03912.66
5.3.200.0080.03912.66
5.3.190.0050.04112.67
5.3.180.0070.03712.72
5.3.170.0060.04112.66
5.3.160.0070.03512.73
5.3.150.0080.03812.65
5.3.140.0020.02812.63
5.3.130.0030.04012.72
5.3.120.0050.04012.72
5.3.110.0110.03812.62
5.3.100.0070.03812.38
5.3.90.0070.03912.39
5.3.80.0030.04012.35
5.3.70.0030.04212.39
5.3.60.0050.04212.34
5.3.50.0050.03812.39
5.3.40.0050.03012.30
5.3.30.0040.03112.30
5.3.20.0030.04212.26
5.3.10.0050.03612.21
5.3.00.0070.03512.25
5.2.170.0070.06312.38
5.2.160.0070.05312.38
5.2.150.0070.06012.38
5.2.140.0030.06312.38
5.2.130.0030.05012.38
5.2.120.0070.05012.38
5.2.110.0070.06012.38
5.2.100.0030.04012.38
5.2.90.0070.05012.38
5.2.80.0000.06012.38
5.2.70.0070.04312.38
5.2.60.0030.05312.38
5.2.50.0030.05012.38
5.2.40.0100.05312.38
5.2.30.0030.06012.38
5.2.20.0030.05012.38
5.2.10.0100.05312.38
5.2.00.0100.05312.38
5.1.60.0070.04712.38
5.1.50.0030.05712.38
5.1.40.0070.03712.38
5.1.30.0030.06012.38
5.1.20.0070.05312.38
5.1.10.0000.05712.38
5.1.00.0030.05312.38
5.0.50.0030.04712.38
5.0.40.0030.04312.38
5.0.30.0000.06712.38
5.0.20.0070.04312.38
5.0.10.0070.04312.38
5.0.00.0000.06712.38
4.4.90.0070.03012.38
4.4.80.0000.02012.38
4.4.70.0070.03312.38
4.4.60.0000.03012.38
4.4.50.0070.02712.38
4.4.40.0030.05012.38
4.4.30.0030.02312.38
4.4.20.0000.02712.38
4.4.10.0030.02712.38
4.4.00.0000.06012.38
4.3.110.0000.02712.38
4.3.100.0130.02312.38
4.3.90.0000.04012.38
4.3.80.0000.05312.38
4.3.70.0070.03312.38
4.3.60.0000.03712.38
4.3.50.0030.02712.38
4.3.40.0000.04712.38
4.3.30.0030.03712.38
4.3.20.0030.03312.38
4.3.10.0030.03312.38
4.3.00.0030.03312.38

preferences:
44.52 ms | 401 KiB | 5 Q