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 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 & 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:///test'; 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.0060.01218.68
8.3.50.0090.00921.15
8.3.40.0150.00019.04
8.3.30.0030.01020.17
8.3.20.0030.00520.61
8.3.10.0080.00021.27
8.3.00.0000.00822.44
8.2.180.0160.00316.48
8.2.170.0120.00922.96
8.2.160.0070.00720.35
8.2.150.0040.00424.18
8.2.140.0100.00324.66
8.2.130.0080.00026.16
8.2.120.0000.00821.21
8.2.110.0000.01119.16
8.2.100.0090.00319.82
8.2.90.0080.00018.28
8.2.80.0040.00418.16
8.2.70.0040.00417.75
8.2.60.0000.00917.93
8.2.50.0000.00818.07
8.2.40.0000.00818.34
8.2.30.0070.00019.38
8.2.20.0080.00017.98
8.2.10.0050.00317.84
8.2.00.0060.00317.87
8.1.280.0110.00325.92
8.1.270.0040.00424.08
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0060.00319.77
8.1.230.0060.00621.02
8.1.220.0000.00817.74
8.1.210.0050.00518.83
8.1.200.0070.00317.38
8.1.190.0030.00617.60
8.1.180.0080.00018.10
8.1.170.0030.00618.89
8.1.160.0030.00618.92
8.1.150.0030.00518.77
8.1.140.0040.00417.55
8.1.130.0040.00417.89
8.1.120.0030.00517.70
8.1.110.0040.00417.61
8.1.100.0030.00517.66
8.1.90.0060.00317.62
8.1.80.0040.00417.64
8.1.70.0070.00017.60
8.1.60.0000.00817.77
8.1.50.0040.00417.72
8.1.40.0040.00417.75
8.1.30.0040.00417.83
8.1.20.0030.00617.87
8.1.10.0050.00317.75
8.1.00.0030.00617.59
8.0.300.0040.00420.26
8.0.290.0040.00417.30
8.0.280.0000.00718.45
8.0.270.0070.00017.23
8.0.260.0070.00018.44
8.0.250.0020.00517.18
8.0.240.0050.00317.14
8.0.230.0040.00417.01
8.0.220.0040.00417.01
8.0.210.0000.00716.97
8.0.200.0060.00017.11
8.0.190.0040.00417.02
8.0.180.0030.00517.11
8.0.170.0000.00716.98
8.0.160.0040.00417.07
8.0.150.0000.00716.90
8.0.140.0040.00417.06
8.0.130.0080.00013.46
8.0.120.0050.00317.04
8.0.110.0000.00717.11
8.0.100.0020.00517.10
8.0.90.0070.00017.07
8.0.80.0090.00617.01
8.0.70.0040.00417.02
8.0.60.0080.00017.14
8.0.50.0060.00317.12
8.0.30.0080.01317.50
8.0.20.0110.01117.41
8.0.10.0040.00417.14
8.0.00.0130.01116.93
7.4.330.0000.00516.75
7.4.320.0000.00716.66
7.4.300.0030.00316.61
7.4.290.0000.00716.77
7.4.280.0030.00516.70
7.4.270.0070.00016.79
7.4.260.0060.00013.64
7.4.250.0000.00816.68
7.4.240.0000.00716.77
7.4.230.0030.00316.73
7.4.220.0090.01016.93
7.4.210.0090.00616.78
7.4.200.0000.00716.66
7.4.190.0040.00316.71
7.4.160.0100.00616.83
7.4.150.0060.01217.40
7.4.140.0090.00917.86
7.4.130.0140.00316.82
7.4.120.0110.00616.60
7.4.110.0100.00616.86
7.4.100.0060.01217.02
7.4.90.0090.00916.64
7.4.80.0140.00419.39
7.4.70.0170.00316.73
7.4.60.0120.01216.64
7.4.50.0090.00016.53
7.4.40.0090.00622.77
7.4.30.0120.00616.76
7.4.00.0040.01415.04
7.3.330.0000.00613.58
7.3.320.0000.00513.54
7.3.310.0030.00316.57
7.3.300.0040.00416.52
7.3.290.0140.00716.54
7.3.280.0110.01116.47
7.3.270.0060.01217.40
7.3.260.0090.00918.24
7.3.250.0070.01016.67
7.3.240.0070.01116.46
7.3.230.0100.00716.51
7.3.210.0000.01716.55
7.3.200.0110.00419.39
7.3.190.0110.01116.77
7.3.180.0120.00916.80
7.3.170.0130.00316.84
7.3.160.0030.01616.71
7.3.120.0080.00815.20
7.3.10.0160.00616.28
7.3.00.0070.01016.51
7.2.330.0040.01316.83
7.2.320.0120.01216.93
7.2.310.0150.00316.98
7.2.300.0110.00616.68
7.2.290.0100.00716.94
7.2.130.0100.01317.09
7.2.120.0170.00617.07
7.2.110.0100.00816.89
7.2.100.0090.01116.99
7.2.90.0110.01016.75
7.2.80.0140.00817.01
7.2.70.0100.01016.59
7.2.60.0070.01217.14
7.2.50.0120.00817.00
7.2.40.0110.01016.75
7.2.30.0120.00516.87
7.2.20.0130.00316.63
7.2.10.0130.00817.16
7.2.00.0090.00817.91
7.1.250.0090.00815.87
7.1.240.0070.00715.83
7.1.230.0030.01315.66
7.1.220.0040.00416.04
7.1.210.0030.00915.99
7.1.200.0000.01515.95
7.1.190.0120.00015.89
7.1.180.0030.01015.92
7.1.170.0030.00916.09
7.1.160.0030.01016.00
7.1.150.0110.00415.97
7.1.140.0030.00916.04
7.1.130.0000.01115.76
7.1.120.0040.00415.85
7.1.110.0000.01315.89
7.1.100.0040.01017.23
7.1.90.0120.00416.09
7.1.80.0040.00815.95
7.1.70.0040.00616.65
7.1.60.0080.00817.43
7.1.50.0130.00925.45
7.1.40.0060.00615.89
7.1.30.0030.00715.95
7.1.20.0030.00616.05
7.1.10.0030.00915.91
7.1.00.0040.02019.14
7.0.330.0060.00315.36
7.0.320.0000.01015.64
7.0.310.0030.00715.55
7.0.300.0030.01015.22
7.0.290.0000.01415.70
7.0.280.0000.00915.28
7.0.270.0090.00015.20
7.0.260.0060.00615.67
7.0.250.0040.00715.60
7.0.240.0000.00815.53
7.0.230.0030.00615.42
7.0.220.0000.01415.81
7.0.210.0040.00415.66
7.0.200.0000.00916.36
7.0.190.0030.00615.65
7.0.180.0030.01015.60
7.0.170.0040.01115.82
7.0.160.0030.00615.46
7.0.150.0000.01315.81
7.0.140.0030.04218.90
7.0.130.0040.01115.75
7.0.120.0040.00815.68
7.0.110.0030.00715.68
7.0.100.0050.03017.84
7.0.90.0060.03117.77
7.0.80.0100.04017.82
7.0.70.0070.02217.75
7.0.60.0080.02217.60
7.0.50.0030.02518.05
7.0.40.0010.02816.88
7.0.30.0020.02516.81
7.0.20.0020.02716.87
7.0.10.0100.03516.85
7.0.00.0070.02316.90
5.6.380.0060.01014.20
5.6.370.0080.00414.40
5.6.360.0070.00314.77
5.6.350.0030.00914.69
5.6.340.0030.01014.46
5.6.330.0070.01014.32
5.6.320.0120.00314.26
5.6.310.0040.00714.44
5.6.300.0070.00714.61
5.6.290.0040.00714.69
5.6.280.0020.04217.56
5.6.270.0140.00014.45
5.6.260.0040.00714.51
5.6.250.0050.04017.73
5.6.240.0070.02917.47
5.6.230.0080.04517.46
5.6.220.0050.02717.49
5.6.210.0020.02717.64
5.6.200.0020.03017.78
5.6.190.0040.02517.81
5.6.180.0050.02517.68
5.6.170.0020.02917.68
5.6.160.0050.03217.94
5.6.150.0030.02917.77
5.6.140.0090.02017.84
5.6.130.0070.02217.74
5.6.120.0020.03817.77
5.6.110.0050.02017.64
5.6.100.0040.02617.77
5.6.90.0020.02417.80
5.6.80.0030.02317.38
5.6.70.0080.02017.36
5.6.60.0020.02617.42
5.6.50.0020.02517.53
5.6.40.0070.01817.34
5.6.30.0020.02617.37
5.6.20.0030.02317.34
5.6.10.0040.02317.44
5.6.00.0050.02317.41
5.5.380.0020.02715.77
5.5.370.0020.04915.88
5.5.360.0050.02215.88
5.5.350.0020.02415.97
5.5.340.0050.02516.17
5.5.330.0020.02315.93
5.5.320.0050.03016.11
5.5.310.0030.02216.08
5.5.300.0040.02316.15
5.5.290.0030.02716.11
5.5.280.0020.02416.14
5.5.270.0020.02316.12
5.5.260.0040.02215.95
5.5.250.0030.02215.88
5.5.240.0020.02515.65
5.5.230.0030.02615.69
5.5.220.0000.02415.80
5.5.210.0030.02015.83
5.5.200.0050.01915.77
5.5.190.0030.02515.71
5.5.180.0000.02415.67
5.5.170.0040.00411.35
5.5.160.0010.02415.57
5.5.150.0020.02815.62
5.5.140.0100.01515.90
5.5.130.0070.01815.72
5.5.120.0080.02415.73
5.5.110.0100.03515.71
5.5.100.0090.02815.61
5.5.90.0070.03315.82
5.5.80.0070.04215.51
5.5.70.0050.02815.56
5.5.60.0040.03915.72
5.5.50.0050.04115.69
5.5.40.0070.04315.69
5.5.30.0070.02715.77
5.5.20.0060.02315.56
5.5.10.0050.02615.60
5.5.00.0100.03815.73
5.4.450.0050.01815.20
5.4.440.0020.02315.27
5.4.430.0020.02515.26
5.4.420.0020.02715.16
5.4.410.0020.02415.00
5.4.400.0000.02415.08
5.4.390.0030.02215.14
5.4.380.0030.02515.10
5.4.370.0050.02115.00
5.4.360.0070.02015.11
5.4.350.0050.02515.22
5.4.340.0000.02415.12
5.4.330.0030.00511.06
5.4.320.0120.01515.16
5.4.310.0060.02615.11
5.4.300.0030.03115.15
5.4.290.0030.03315.16
5.4.280.0070.03214.99
5.4.270.0090.03814.85
5.4.260.0060.04314.95
5.4.250.0030.03915.15
5.4.240.0050.02615.09
5.4.230.0030.03615.11
5.4.220.0030.03015.30
5.4.210.0060.02314.83
5.4.200.0050.04514.96
5.4.190.0050.04015.08
5.4.180.0090.03715.17
5.4.170.0100.02015.06
5.4.160.0090.03014.92
5.4.150.0050.04315.26
5.4.140.0040.02813.60
5.4.130.0040.04213.89
5.4.120.0060.03413.75
5.4.110.0080.03813.85
5.4.100.0070.03413.62
5.4.90.0020.03113.96
5.4.80.0050.03813.60
5.4.70.0020.03913.81
5.4.60.0050.04213.78
5.4.50.0070.02713.84
5.4.40.0040.02813.71
5.4.30.0050.04113.84
5.4.20.0050.02013.82
5.4.10.0030.03813.50
5.4.00.0020.02713.50
5.3.290.0050.02112.49
5.3.280.0070.03212.45
5.3.270.0060.04112.44
5.3.260.0020.04212.48
5.3.250.0060.03812.51
5.3.240.0080.03812.40
5.3.230.0000.04212.45
5.3.220.0070.03912.47
5.3.210.0070.03712.40
5.3.200.0080.04212.53
5.3.190.0050.04212.41
5.3.180.0050.02512.48
5.3.170.0070.02712.50
5.3.160.0050.03512.38
5.3.150.0060.04012.49
5.3.140.0070.03812.41
5.3.130.0000.04012.45
5.3.120.0070.03912.46
5.3.110.0060.03812.44
5.3.100.0020.03612.22
5.3.90.0070.02812.23
5.3.80.0060.03812.29
5.3.70.0030.02912.23
5.3.60.0060.03712.22
5.3.50.0050.02012.18
5.3.40.0080.02512.04
5.3.30.0050.03712.13
5.3.20.0050.03512.04
5.3.10.0080.03112.02
5.3.00.0030.03311.91
5.2.170.0080.02211.05
5.2.160.0050.03211.05
5.2.150.0030.03611.05
5.2.140.0000.02211.05
5.2.130.0060.02511.05
5.2.120.0030.03311.05
5.2.110.0050.02811.05
5.2.100.0030.02011.05
5.2.90.0100.01311.05
5.2.80.0030.03111.05
5.2.70.0030.02611.05
5.2.60.0030.03711.05
5.2.50.0050.03311.05
5.2.40.0040.03311.05
5.2.30.0070.03211.05
5.2.20.0070.03111.05
5.2.10.0020.03311.05
5.2.00.0050.03211.05
5.1.60.0020.03011.05
5.1.50.0050.02011.05
5.1.40.0000.02411.05
5.1.30.0020.02911.05
5.1.20.0030.03011.05
5.1.10.0070.02811.05
5.1.00.0000.03311.05
5.0.50.0030.02311.05
5.0.40.0000.02711.05
5.0.30.0040.02511.05
5.0.20.0020.01711.05
5.0.10.0050.02011.05
5.0.00.0020.02011.05
4.4.90.0020.01911.05
4.4.80.0030.01211.05
4.4.70.0020.01611.05
4.4.60.0030.02011.05
4.4.50.0020.01811.05
4.4.40.0010.02811.05
4.4.30.0020.02411.05
4.4.20.0030.01611.05
4.4.10.0020.02311.05
4.4.00.0020.03011.05
4.3.110.0020.01611.05
4.3.100.0000.01611.05
4.3.90.0020.01511.05
4.3.80.0040.01811.05
4.3.70.0070.01511.05
4.3.60.0000.01611.05
4.3.50.0000.01911.05
4.3.40.0070.02311.05
4.3.30.0020.02011.05
4.3.20.0000.02111.05
4.3.10.0030.02011.05
4.3.00.0020.01511.05

preferences:
53.01 ms | 401 KiB | 5 Q