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 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 & 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; }

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.0070.00718.43
8.3.50.0120.00821.09
8.3.40.0120.00318.85
8.3.30.0070.00720.09
8.3.20.0080.00020.23
8.3.10.0050.00220.92
8.3.00.0000.00822.44
8.2.180.0150.00616.50
8.2.170.0100.00622.96
8.2.160.0030.01320.52
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0070.00021.05
8.2.110.0050.00519.33
8.2.100.0100.00019.82
8.2.90.0000.00817.63
8.2.80.0040.00417.97
8.2.70.0060.00317.90
8.2.60.0040.00417.97
8.2.50.0000.00818.10
8.2.40.0000.00919.34
8.2.30.0000.00819.20
8.2.20.0040.00417.61
8.2.10.0040.00417.64
8.2.00.0040.00417.51
8.1.280.0110.00825.92
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0050.00228.09
8.1.240.0080.00417.35
8.1.230.0110.00417.50
8.1.220.0040.00417.74
8.1.210.0000.01118.77
8.1.200.0030.00617.23
8.1.190.0040.00417.23
8.1.180.0000.00818.10
8.1.170.0080.00018.53
8.1.160.0030.00618.84
8.1.150.0040.00418.86
8.1.140.0040.00417.39
8.1.130.0080.00017.72
8.1.120.0040.00417.41
8.1.110.0040.00417.41
8.1.100.0000.00717.48
8.1.90.0030.00617.41
8.1.80.0000.00817.47
8.1.70.0050.00317.26
8.1.60.0030.00617.48
8.1.50.0050.00217.37
8.1.40.0080.00017.53
8.1.30.0030.00617.56
8.1.20.0000.00817.44
8.1.10.0000.00817.31
8.1.00.0040.00417.33
8.0.300.0090.00018.77
8.0.290.0000.00716.63
8.0.280.0030.00318.29
8.0.270.0070.00017.16
8.0.260.0000.00616.70
8.0.250.0040.00416.89
8.0.240.0060.00316.90
8.0.230.0040.00416.99
8.0.220.0030.00316.93
8.0.210.0040.00416.84
8.0.200.0000.00616.97
8.0.190.0040.00416.90
8.0.180.0000.00716.84
8.0.170.0040.00416.84
8.0.160.0030.00416.86
8.0.150.0070.00016.78
8.0.140.0030.00316.85
8.0.130.0030.00313.30
8.0.120.0000.00716.90
8.0.110.0040.00416.78
8.0.100.0000.00816.90
8.0.90.0040.00416.79
8.0.80.0080.00816.79
8.0.70.0000.00716.98
8.0.60.0020.00516.94
8.0.50.0060.00316.89
8.0.30.0050.01316.91
8.0.20.0030.01517.40
8.0.10.0040.00416.88
8.0.00.0110.01116.61
7.4.330.0050.00016.77
7.4.320.0070.00016.47
7.4.300.0040.00416.48
7.4.290.0030.00316.51
7.4.280.0000.00716.31
7.4.270.0000.00716.33
7.4.260.0060.00013.14
7.4.250.0000.00816.56
7.4.240.0030.00416.51
7.4.230.0000.00716.39
7.4.220.0060.01716.39
7.4.210.0060.00816.52
7.4.200.0000.00716.38
7.4.190.0000.00716.68
7.4.160.0100.00716.29
7.4.150.0090.00917.40
7.4.140.0110.00917.86
7.4.130.0090.00916.60
7.4.120.0150.00516.48
7.4.110.0090.00916.45
7.4.100.0070.01016.52
7.4.90.0110.00616.46
7.4.80.0110.01119.39
7.4.70.0080.00816.32
7.4.60.0160.00416.49
7.4.50.0030.00616.59
7.4.40.0120.00322.77
7.4.30.0180.00316.49
7.4.00.0070.01015.05
7.3.330.0000.00513.34
7.3.320.0050.00013.36
7.3.310.0040.00416.27
7.3.300.0030.00316.15
7.3.290.0000.01416.30
7.3.280.0130.00716.32
7.3.270.0050.01617.40
7.3.260.0130.00818.24
7.3.250.0100.00816.49
7.3.240.0030.01316.62
7.3.230.0130.00316.55
7.3.210.0100.00716.47
7.3.200.0080.01319.39
7.3.190.0170.00016.29
7.3.180.0060.01016.39
7.3.170.0030.01316.41
7.3.160.0070.01016.36
7.3.120.0130.00414.82
7.3.110.0100.00714.53
7.3.100.0150.00314.94
7.3.90.0100.00614.88
7.3.80.0030.01414.65
7.3.70.0070.00414.59
7.3.60.0070.00714.58
7.3.50.0060.00914.71
7.3.40.0090.00314.58
7.3.30.0070.00414.89
7.3.20.0080.00316.39
7.3.10.0030.01016.56
7.3.00.0000.01316.46
7.2.330.0060.01216.46
7.2.320.0070.01516.50
7.2.310.0070.01116.69
7.2.300.0040.01316.50
7.2.290.0130.00316.43
7.2.250.0090.00914.44
7.2.240.0030.01415.04
7.2.230.0140.00314.71
7.2.220.0120.00415.03
7.2.210.0130.00615.05
7.2.200.0110.00414.96
7.2.190.0070.00715.14
7.2.180.0090.00014.86
7.2.170.0000.01614.88
7.2.160.0070.00714.96
7.2.150.0070.00716.83
7.2.140.0060.00316.76
7.2.130.0000.01216.82
7.2.120.0060.00616.68
7.2.110.0090.00616.84
7.2.100.0060.00316.48
7.2.90.0060.01016.91
7.2.80.0070.00716.37
7.2.70.0030.01416.69
7.2.60.0090.00416.77
7.2.50.0090.00316.82
7.2.40.0080.00416.96
7.2.30.0000.01516.87
7.2.20.0040.01116.53
7.2.10.0050.00516.85
7.2.00.0030.01318.04
7.1.330.0100.00315.49
7.1.320.0160.00315.85
7.1.310.0040.00715.62
7.1.300.0060.00615.42
7.1.290.0070.00315.64
7.1.280.0040.01115.56
7.1.270.0000.00915.46
7.1.260.0030.01015.71
7.1.250.0070.00715.67
7.1.240.0060.00915.61
7.1.230.0080.00415.59
7.1.220.0030.00815.43
7.1.210.0110.00415.78
7.1.200.0090.00315.40
7.1.190.0060.00615.28
7.1.180.0000.01215.64
7.1.170.0040.01215.65
7.1.160.0040.01115.71
7.1.150.0000.01115.65
7.1.140.0050.00515.67
7.1.130.0040.00815.74
7.1.120.0060.00815.40
7.1.110.0130.00015.74
7.1.100.0060.00416.81
7.1.90.0040.00715.82
7.1.80.0110.00315.86
7.1.70.0070.00616.41
7.1.60.0070.01017.34
7.1.50.0160.00625.19
7.1.40.0040.00715.65
7.1.30.0000.01315.80
7.1.20.0030.01215.48
7.1.10.0070.00815.64
7.1.00.0050.02019.02
7.0.330.0070.00415.40
7.0.320.0100.00015.07
7.0.310.0030.01015.49
7.0.300.0100.00315.45
7.0.290.0070.00715.20
7.0.280.0060.00914.93
7.0.270.0060.00615.27
7.0.260.0090.00315.11
7.0.250.0090.00615.40
7.0.240.0030.00615.24
7.0.230.0120.00315.46
7.0.220.0080.00415.34
7.0.210.0060.00314.93
7.0.200.0080.00315.96
7.0.190.0050.00515.37
7.0.180.0040.01115.39
7.0.170.0070.00715.29
7.0.160.0040.01215.04
7.0.150.0030.00915.17
7.0.140.0100.03518.71
7.0.130.0040.00415.15
7.0.120.0040.00815.49
7.0.110.0080.00515.41
7.0.100.0110.04017.64
7.0.90.0070.04117.64
7.0.80.0080.04217.61
7.0.70.0050.04017.55
7.0.60.0060.04617.66
7.0.50.0250.04817.95
7.0.40.0120.03816.85
7.0.30.0080.04616.66
7.0.20.0030.04616.65
7.0.10.0120.03816.80
7.0.00.0050.04416.72
5.6.400.0080.00414.03
5.6.390.0060.00314.23
5.6.380.0110.00614.05
5.6.370.0040.01114.07
5.6.360.0040.00814.39
5.6.350.0090.00614.19
5.6.340.0060.00914.47
5.6.330.0080.00414.24
5.6.320.0000.01014.22
5.6.310.0060.00914.11
5.6.300.0040.01414.08
5.6.290.0070.01014.25
5.6.280.0060.03817.49
5.6.270.0090.00614.19
5.6.260.0000.01214.25
5.6.250.0070.04217.41
5.6.240.0070.04517.44
5.6.230.0080.03617.54
5.6.220.0090.04117.42
5.6.210.0050.04017.35
5.6.200.0100.04017.47
5.6.190.0030.05217.51
5.6.180.0100.04217.63
5.6.170.0070.04517.70
5.6.160.0030.04417.62
5.6.150.0030.04317.67
5.6.140.0070.04417.65
5.6.130.0080.04517.61
5.6.120.0030.04517.63
5.6.110.0130.03917.69
5.6.100.0100.03517.85
5.6.90.0080.04417.51
5.6.80.0050.03017.30
5.6.70.0080.02917.25
5.6.60.0080.02817.14
5.6.50.0030.02617.21
5.6.40.0070.04517.21
5.6.30.0070.04217.23
5.6.20.0050.05017.28
5.6.10.0080.04017.45
5.6.00.0100.04017.25
5.5.380.0030.04217.30
5.5.370.0070.04217.26
5.5.360.0080.02617.14
5.5.350.0070.03317.31
5.5.340.0020.04917.54
5.5.330.0080.04517.40
5.5.320.0060.04817.49
5.5.310.0120.04117.47
5.5.300.0050.04817.45
5.5.290.0130.04117.45
5.5.280.0130.03517.46
5.5.270.0100.04317.57
5.5.260.0060.04617.56
5.5.250.0070.04417.26
5.5.240.0120.03417.15
5.5.230.0070.03517.16
5.5.220.0030.03017.14
5.5.210.0100.02017.21
5.5.200.0080.02217.18
5.5.190.0080.04217.02
5.5.180.0060.02517.10
5.5.170.0090.00614.13
5.5.160.0030.04417.12
5.5.150.0050.03716.85
5.5.140.0040.02917.04
5.5.130.0030.04717.18
5.5.120.0120.03717.05
5.5.110.0060.03517.18
5.5.100.0080.04317.11
5.5.90.0090.03717.03
5.5.80.0000.04917.01
5.5.70.0080.03817.10
5.5.60.0060.02716.81
5.5.50.0050.04217.10
5.5.40.0070.02916.96
5.5.30.0070.04116.99
5.5.20.0080.03317.16
5.5.10.0080.02817.02
5.5.00.0050.04217.05
5.4.450.0030.04915.97
5.4.440.0100.03815.91
5.4.430.0070.04015.90
5.4.420.0050.02515.95
5.4.410.0090.04115.83
5.4.400.0080.03015.77
5.4.390.0050.02315.67
5.4.380.0050.02315.70
5.4.370.0080.03715.84
5.4.360.0080.03815.83
5.4.350.0080.03715.80
5.4.340.0030.02615.84
5.4.330.0080.00312.45
5.4.320.0060.03915.79
5.4.310.0080.03715.74
5.4.300.0000.04715.74
5.4.290.0060.04015.75
5.4.280.0050.04515.70
5.4.270.0050.03015.74
5.4.260.0040.03915.81
5.4.250.0080.03515.74
5.4.240.0030.04515.74
5.4.230.0030.02815.64
5.4.220.0070.02415.80
5.4.210.0050.04215.73
5.4.200.0090.03415.70
5.4.190.0120.03315.74
5.4.180.0090.03815.64
5.4.170.0080.04015.74
5.4.160.0100.03515.78
5.4.150.0080.03815.83
5.4.140.0020.02714.48
5.4.130.0070.03814.45
5.4.120.0060.02314.41
5.4.110.0020.02714.49
5.4.100.0050.03114.41
5.4.90.0030.04114.45
5.4.80.0070.03714.49
5.4.70.0110.01814.44
5.4.60.0050.03114.35
5.4.50.0050.04014.46
5.4.40.0090.02114.45
5.4.30.0100.03814.49
5.4.20.0030.04014.38
5.4.10.0020.04214.44
5.4.00.0070.03614.07
5.3.290.0090.02813.55
5.3.280.0030.04313.54
5.3.270.0060.03813.50
5.3.260.0060.04113.54
5.3.250.0020.04713.53
5.3.240.0040.03313.52
5.3.230.0020.04413.57
5.3.220.0100.02813.52
5.3.210.0060.03513.51
5.3.200.0020.02213.54
5.3.190.0000.03513.52
5.3.180.0070.04013.51
5.3.170.0050.03013.51
5.3.160.0080.03413.54
5.3.150.0090.02413.47
5.3.140.0030.04413.54
5.3.130.0030.03813.51
5.3.120.0070.02413.48
5.3.110.0040.02913.56
5.3.100.0090.03013.24
5.3.90.0100.03713.21
5.3.80.0070.02013.30
5.3.70.0050.04013.24
5.3.60.0030.02313.24
5.3.50.0060.03613.19
5.3.40.0100.03513.15
5.3.30.0020.03913.21
5.3.20.0020.03513.06
5.3.10.0020.04213.06
5.3.00.0020.04413.10
5.2.170.0030.06011.29
5.2.160.0030.04011.29
5.2.150.0070.04711.29
5.2.140.0030.06311.29
5.2.130.0070.06311.29
5.2.120.0030.06711.29
5.2.110.0000.05311.29
5.2.100.0130.05311.29
5.2.90.0070.03011.29
5.2.80.0070.05711.29
5.2.70.0100.05311.29
5.2.60.0070.05711.29
5.2.50.0070.06011.29
5.2.40.0000.05311.29
5.2.30.0070.03711.29
5.2.20.0030.06711.29
5.2.10.0030.03311.29
5.2.00.0070.06011.29
5.1.60.0000.04311.29
5.1.50.0070.04311.29
5.1.40.0030.04311.29
5.1.30.0070.02711.29
5.1.20.0000.02711.29
5.1.10.0100.02711.29
5.1.00.0070.04311.29
5.0.50.0030.03711.29
5.0.40.0100.02011.29
5.0.30.0000.06311.29
5.0.20.0030.04311.29
5.0.10.0030.04011.29
5.0.00.0030.03711.29
4.4.90.0070.02011.29
4.4.80.0000.04011.29
4.4.70.0070.03711.29
4.4.60.0000.03711.29
4.4.50.0030.02011.29
4.4.40.0070.05011.29
4.4.30.0000.04311.29
4.4.20.0030.02311.29
4.4.10.0030.03711.29
4.4.00.0030.04011.29
4.3.110.0070.03011.29
4.3.100.0030.03311.29
4.3.90.0000.03311.29
4.3.80.0000.05711.29
4.3.70.0030.03011.29
4.3.60.0030.03711.29
4.3.50.0000.02311.29
4.3.40.0030.04711.29
4.3.30.0000.03011.29
4.3.20.0000.03711.29
4.3.10.0000.03711.29
4.3.00.0130.01711.29

preferences:
37.74 ms | 401 KiB | 5 Q