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.0120.00618.65
8.3.50.0090.00821.33
8.3.40.0070.00719.14
8.3.30.0100.00320.34
8.3.20.0060.00318.99
8.3.10.0040.00421.08
8.3.00.0050.00322.26
8.2.180.0100.01018.41
8.2.170.0100.00722.96
8.2.160.0040.01120.53
8.2.150.0040.00424.18
8.2.140.0000.01124.66
8.2.130.0060.00326.16
8.2.120.0090.00021.04
8.2.110.0100.00019.20
8.2.100.0060.00617.91
8.2.90.0000.00819.35
8.2.80.0050.00318.05
8.2.70.0060.00317.88
8.2.60.0000.00817.93
8.2.50.0060.00318.07
8.2.40.0030.00618.22
8.2.30.0000.00719.51
8.2.20.0000.00817.82
8.2.10.0100.00017.85
8.2.00.0040.00417.92
8.1.280.0040.01125.92
8.1.270.0040.00423.99
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0060.00323.88
8.1.230.0060.00621.09
8.1.220.0030.00518.77
8.1.210.0000.00819.10
8.1.200.0000.01017.60
8.1.190.0000.00817.73
8.1.180.0000.00818.10
8.1.170.0000.00818.84
8.1.160.0070.00018.90
8.1.150.0000.00818.75
8.1.140.0000.00817.61
8.1.130.0000.00717.77
8.1.120.0050.00317.55
8.1.110.0080.00017.68
8.1.100.0000.00817.54
8.1.90.0050.00317.67
8.1.80.0000.00717.67
8.1.70.0040.00417.64
8.1.60.0040.00417.73
8.1.50.0000.00817.64
8.1.40.0060.00317.61
8.1.30.0040.00417.71
8.1.20.0030.00617.75
8.1.10.0030.00617.75
8.1.00.0040.00417.70
8.0.300.0050.00319.91
8.0.290.0040.00417.02
8.0.280.0040.00418.45
8.0.270.0000.00717.32
8.0.260.0070.00017.06
8.0.250.0000.00717.02
8.0.240.0030.00617.14
8.0.230.0040.00417.14
8.0.220.0030.00317.10
8.0.210.0070.00016.97
8.0.200.0030.00317.12
8.0.190.0000.00717.05
8.0.180.0040.00417.00
8.0.170.0000.00716.98
8.0.160.0000.00717.14
8.0.150.0000.00717.11
8.0.140.0000.00817.08
8.0.130.0030.00313.57
8.0.120.0060.00317.06
8.0.110.0000.00816.92
8.0.100.0040.00417.13
8.0.90.0030.00516.91
8.0.80.0000.01717.09
8.0.70.0040.00417.15
8.0.60.0040.00416.94
8.0.50.0000.00817.20
8.0.30.0080.01217.34
8.0.20.0120.00817.43
8.0.10.0000.00717.05
8.0.00.0150.00517.01
7.4.330.0000.00516.72
7.4.320.0000.00616.76
7.4.300.0030.00316.90
7.4.290.0000.00716.66
7.4.280.0050.00216.89
7.4.270.0070.00016.81
7.4.260.0030.00313.53
7.4.250.0000.00816.83
7.4.240.0040.00316.84
7.4.230.0070.00016.52
7.4.220.0150.00316.69
7.4.210.0120.00516.80
7.4.200.0000.00816.66
7.4.190.0000.00816.82
7.4.160.0000.01616.95
7.4.150.0070.01617.40
7.4.140.0100.00917.86
7.4.130.0090.01116.85
7.4.120.0090.01016.79
7.4.110.0150.00316.68
7.4.100.0060.01616.95
7.4.90.0030.01416.61
7.4.80.0130.00619.39
7.4.70.0030.02017.01
7.4.60.0100.01016.76
7.4.50.0030.00716.75
7.4.40.0060.00922.77
7.4.30.0110.01116.77
7.4.10.0000.01414.89
7.4.00.0030.01415.15
7.3.330.0000.00513.55
7.3.320.0000.00513.50
7.3.310.0070.00016.43
7.3.300.0030.00316.53
7.3.290.0030.01016.49
7.3.280.0090.00916.53
7.3.270.0100.01317.40
7.3.260.0110.00818.24
7.3.250.0140.00716.66
7.3.240.0030.01516.64
7.3.230.0180.00416.63
7.3.210.0130.00416.58
7.3.200.0120.00919.39
7.3.190.0130.00416.72
7.3.180.0150.00316.63
7.3.170.0090.00616.50
7.3.160.0000.01716.71
7.3.130.0070.01014.96
7.3.120.0030.01314.97
7.3.110.0110.00814.77
7.3.100.0000.01815.15
7.3.90.0060.00915.29
7.3.80.0140.00315.07
7.3.70.0060.01115.21
7.3.60.0100.00615.16
7.3.50.0040.00815.18
7.3.40.0070.00715.13
7.3.30.0000.01514.85
7.3.20.0090.00316.98
7.3.10.0090.00616.79
7.3.00.0060.01016.89
7.2.330.0130.00716.82
7.2.320.0070.01517.04
7.2.310.0130.00316.97
7.2.300.0130.00616.91
7.2.290.0130.01016.86
7.2.260.0030.01715.05
7.2.250.0040.01115.31
7.2.240.0060.01115.52
7.2.230.0070.01015.31
7.2.220.0090.00915.19
7.2.210.0060.00915.20
7.2.200.0030.01215.35
7.2.190.0000.01215.10
7.2.180.0100.00315.20
7.2.170.0040.00915.32
7.2.160.0000.01015.08
7.2.150.0040.00817.08
7.2.140.0100.00617.21
7.2.130.0040.01017.04
7.2.120.0030.00817.21
7.2.110.0050.01017.14
7.2.100.0100.00317.08
7.2.90.0050.00817.13
7.2.80.0060.01017.13
7.2.70.0110.00317.19
7.2.60.0060.00617.29
7.2.50.0120.00217.08
7.2.40.0050.00917.07
7.2.30.0070.01017.30
7.2.20.0080.00717.20
7.2.10.0050.00716.98
7.2.00.0050.01017.78
7.1.330.0000.01516.24
7.1.320.0060.00916.04
7.1.310.0130.00316.09
7.1.300.0070.00716.02
7.1.290.0080.00815.93
7.1.280.0030.00615.90
7.1.270.0100.00316.06
7.1.260.0030.01016.13
7.1.250.0030.00716.05
7.1.240.0090.00315.99
7.1.230.0060.00316.05
7.1.220.0000.00815.84
7.1.210.0040.00415.94
7.1.200.0120.00316.12
7.1.190.0040.00816.21
7.1.180.0030.01015.77
7.1.170.0030.00716.07
7.1.160.0040.01115.93
7.1.150.0120.00015.64
7.1.140.0060.00616.11
7.1.130.0040.00716.10
7.1.120.0100.00015.83
7.1.110.0070.00716.07
7.1.100.0020.01317.35
7.1.90.0060.00616.21
7.1.80.0040.01115.88
7.1.70.0020.01116.67
7.1.60.0120.00917.66
7.1.50.0060.01125.24
7.1.40.0060.01015.76
7.1.30.0090.00616.11
7.1.20.0040.01216.08
7.1.10.0100.00315.95
7.1.00.0070.03019.23
7.0.330.0040.00815.70
7.0.320.0030.00915.66
7.0.310.0100.00715.70
7.0.300.0030.01015.52
7.0.290.0070.00715.54
7.0.280.0040.00415.63
7.0.270.0030.01015.27
7.0.260.0050.00515.76
7.0.250.0080.00615.66
7.0.240.0030.00815.69
7.0.230.0040.00815.74
7.0.220.0070.00315.30
7.0.210.0060.00915.48
7.0.200.0050.00516.10
7.0.190.0130.00315.59
7.0.180.0100.00315.63
7.0.170.0100.00715.73
7.0.160.0070.01015.55
7.0.150.0040.01115.44
7.0.140.0050.04218.82
7.0.130.0030.01315.68
7.0.120.0130.00315.52
7.0.110.0040.00715.77
7.0.100.0210.03617.69
7.0.90.0220.04317.69
7.0.80.0200.04717.71
7.0.70.0180.03717.68
7.0.60.0150.04817.59
7.0.50.0220.04317.94
7.0.40.0080.04216.79
7.0.30.0020.05116.82
7.0.20.0080.04216.77
7.0.10.0110.02816.80
7.0.00.0070.04016.95
5.6.400.0060.00914.74
5.6.390.0100.00314.67
5.6.380.0090.00614.54
5.6.370.0090.00614.32
5.6.360.0030.01414.40
5.6.350.0090.00014.46
5.6.340.0030.01014.85
5.6.330.0110.00414.52
5.6.320.0070.00714.82
5.6.310.0000.01014.69
5.6.300.0040.01214.64
5.6.290.0040.01514.71
5.6.280.0030.04217.64
5.6.270.0100.00714.63
5.6.260.0060.00614.59
5.6.250.0070.04217.70
5.6.240.0100.04617.57
5.6.230.0120.04217.72
5.6.220.0030.03217.51
5.6.210.0100.02217.77
5.6.200.0020.03517.94
5.6.190.0130.03417.66
5.6.180.0080.04517.72
5.6.170.0080.04217.89
5.6.160.0100.03717.78
5.6.150.0010.04617.81
5.6.140.0050.04817.93
5.6.130.0100.03017.86
5.6.120.0030.03017.87
5.6.110.0070.04217.86
5.6.100.0030.05017.70
5.6.90.0090.04417.69
5.6.80.0020.04417.48
5.6.70.0080.04317.42
5.6.60.0070.03317.50
5.6.50.0060.04217.55
5.6.40.0060.03717.44
5.6.30.0020.03217.46
5.6.20.0070.04617.39
5.6.10.0080.03517.38
5.6.00.0060.04117.51
5.5.380.0030.04617.62
5.5.370.0080.02617.48
5.5.360.0100.04317.28
5.5.350.0080.04217.32
5.5.340.0080.03517.67
5.5.330.0130.04017.75
5.5.320.0070.04417.65
5.5.310.0030.04917.66
5.5.300.0120.03417.52
5.5.290.0060.04517.47
5.5.280.0020.04217.65
5.5.270.0030.04517.71
5.5.260.0050.04017.38
5.5.250.0050.04017.57
5.5.240.0100.03517.29
5.5.230.0070.03117.34
5.5.220.0030.02517.24
5.5.210.0050.02317.22
5.5.200.0070.03817.07
5.5.190.0050.04117.42
5.5.180.0100.02617.38
5.5.170.0040.01414.29
5.5.160.0080.03917.21
5.5.150.0080.04617.25
5.5.140.0000.03317.20
5.5.130.0110.02517.20
5.5.120.0070.04317.21
5.5.110.0030.04817.24
5.5.100.0070.03717.11
5.5.90.0070.04117.37
5.5.80.0070.03617.14
5.5.70.0060.04117.07
5.5.60.0100.04417.31
5.5.50.0100.02517.23
5.5.40.0080.02517.14
5.5.30.0090.04217.15
5.5.20.0070.04617.13
5.5.10.0000.03217.07
5.5.00.0050.04217.08
5.4.450.0110.03815.40
5.4.440.0050.02715.12
5.4.430.0070.03915.40
5.4.420.0050.02715.18
5.4.410.0070.03715.29
5.4.400.0050.04215.24
5.4.390.0090.03315.16
5.4.380.0080.03315.19
5.4.370.0070.03815.12
5.4.360.0050.02415.05
5.4.350.0030.03914.93
5.4.340.0100.04015.01
5.4.330.0000.01411.01
5.4.320.0100.02715.09
5.4.310.0110.03715.06
5.4.300.0050.04215.06
5.4.290.0040.03815.07
5.4.280.0120.04315.09
5.4.270.0040.02715.10
5.4.260.0050.04415.15
5.4.250.0140.03215.05
5.4.240.0050.03815.12
5.4.230.0080.03915.16
5.4.220.0050.04715.07
5.4.210.0070.04015.06
5.4.200.0050.04115.00
5.4.190.0050.04014.94
5.4.180.0030.04514.94
5.4.170.0030.02715.13
5.4.160.0050.03214.95
5.4.150.0070.03415.13
5.4.140.0070.02713.74
5.4.130.0050.04013.77
5.4.120.0030.04313.88
5.4.110.0050.04013.82
5.4.100.0110.02313.88
5.4.90.0080.03913.75
5.4.80.0070.04113.89
5.4.70.0030.04113.68
5.4.60.0100.03813.99
5.4.50.0030.04613.84
5.4.40.0070.02213.83
5.4.30.0070.03813.70
5.4.20.0110.03313.76
5.4.10.0050.04413.69
5.4.00.0100.03313.41
5.3.290.0020.03412.50
5.3.280.0020.04512.49
5.3.270.0090.02912.40
5.3.260.0040.01912.44
5.3.250.0060.03512.47
5.3.240.0040.04312.44
5.3.230.0050.03612.43
5.3.220.0040.04112.39
5.3.210.0050.04012.40
5.3.200.0020.04612.44
5.3.190.0150.02112.52
5.3.180.0050.03612.52
5.3.170.0050.02412.55
5.3.160.0060.03212.44
5.3.150.0050.02112.40
5.3.140.0090.04012.35
5.3.130.0120.03712.48
5.3.120.0050.04312.41
5.3.110.0080.03512.43
5.3.100.0070.03912.27
5.3.90.0100.03712.25
5.3.80.0050.04312.13
5.3.70.0070.03612.10
5.3.60.0060.04112.12
5.3.50.0050.04312.10
5.3.40.0070.03312.12
5.3.30.0080.02012.16
5.3.20.0050.04111.96
5.3.10.0050.03711.90
5.3.00.0020.04011.87
5.2.170.0100.03010.93
5.2.160.0030.06311.18
5.2.150.0030.04011.17
5.2.140.0000.06311.09
5.2.130.0070.05710.92
5.2.120.0030.06311.17
5.2.110.0030.04311.13
5.2.100.0100.05711.13
5.2.90.0070.03710.94
5.2.80.0130.05310.89
5.2.70.0070.05711.01
5.2.60.0070.06010.87
5.2.50.0100.05711.02
5.2.40.0070.05710.97
5.2.30.0100.06010.97
5.2.20.0030.06010.91
5.2.10.0030.06010.75
5.2.00.0000.04010.77
5.1.60.0030.02710.04
5.1.50.0030.05710.02
5.1.40.0030.0579.96
5.1.30.0000.04310.34
5.1.20.0000.05010.29
5.1.10.0000.0579.90
5.1.00.0000.05310.07
5.0.50.0100.0278.57
5.0.40.0000.0238.39
5.0.30.0070.0608.29
5.0.20.0030.0438.29
5.0.10.0030.0208.29
5.0.00.0070.0608.29
4.4.90.0000.0408.29
4.4.80.0070.0278.29
4.4.70.0030.0338.29
4.4.60.0100.0178.29
4.4.50.0070.0278.29
4.4.40.0030.0538.29
4.4.30.0030.0338.29
4.4.20.0000.0308.29
4.4.10.0000.0208.29
4.4.00.0030.0508.29
4.3.110.0000.0338.29
4.3.100.0030.0178.29
4.3.90.0030.0178.29
4.3.80.0030.0408.29
4.3.70.0100.0278.29
4.3.60.0030.0338.29
4.3.50.0000.0208.29
4.3.40.0000.0378.29
4.3.30.0000.0378.29
4.3.20.0070.0338.29
4.3.10.0000.0308.29
4.3.00.0000.0308.29

preferences:
65.35 ms | 401 KiB | 5 Q