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 = '!^(?:([a-zA-Z][a-zA-Z0-9+.\-]*):)?(?:(//)(?:([^:@/\s]+)(?::([^:@/\s]+))?@)?([^:/?#\s]*)(?::([0-9]+))?(?=[/?#]|$))?([^?#\s]+)?(?:\?([^#\s]+))?(?:#(\S+))?$!'; if (!preg_match($pattern, trim($url), $matches)) { return false; } print_r($matches); 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; } parse_url('scheme://user:pass@host:12345/path?query#fragment');

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.0110.00718.45
8.3.50.0050.01421.33
8.3.40.0090.00619.09
8.3.30.0100.00320.26
8.3.20.0050.00319.01
8.3.10.0000.00921.23
8.3.00.0090.00022.34
8.2.180.0150.00618.66
8.2.170.0120.00322.96
8.2.160.0070.00720.65
8.2.150.0080.00024.18
8.2.140.0110.00024.66
8.2.130.0000.00826.16
8.2.120.0040.00421.04
8.2.110.0000.01019.32
8.2.100.0090.00318.03
8.2.90.0040.00419.22
8.2.80.0000.00817.97
8.2.70.0040.00417.88
8.2.60.0000.00818.03
8.2.50.0040.00418.07
8.2.40.0000.00818.16
8.2.30.0060.00319.38
8.2.20.0050.00317.79
8.2.10.0040.00417.81
8.2.00.0050.00317.93
8.1.280.0120.00325.92
8.1.270.0050.00323.99
8.1.260.0050.00226.35
8.1.250.0000.00728.09
8.1.240.0090.00320.86
8.1.230.0110.00021.10
8.1.220.0000.00818.77
8.1.210.0090.00319.20
8.1.200.0090.00017.38
8.1.190.0000.00817.65
8.1.180.0000.00918.10
8.1.170.0050.00318.82
8.1.160.0040.00419.00
8.1.150.0000.00818.76
8.1.140.0040.00417.70
8.1.130.0030.00317.82
8.1.120.0000.00717.56
8.1.110.0000.00817.73
8.1.100.0000.00817.54
8.1.90.0070.00017.66
8.1.80.0000.00717.54
8.1.70.0050.00317.62
8.1.60.0060.00317.77
8.1.50.0050.00217.75
8.1.40.0040.00417.77
8.1.30.0050.00317.82
8.1.20.0040.00417.89
8.1.10.0080.00017.78
8.1.00.0050.00317.75
8.0.300.0040.00420.01
8.0.290.0050.00217.18
8.0.280.0040.00418.43
8.0.270.0000.00817.29
8.0.260.0050.00316.90
8.0.250.0000.00717.13
8.0.240.0030.00617.04
8.0.230.0040.00317.16
8.0.220.0000.00717.09
8.0.210.0000.00717.07
8.0.200.0040.00417.03
8.0.190.0070.00017.01
8.0.180.0030.00517.07
8.0.170.0050.00217.01
8.0.160.0030.00316.96
8.0.150.0000.00717.00
8.0.140.0020.00516.97
8.0.130.0030.00313.55
8.0.120.0030.00617.12
8.0.110.0000.00817.13
8.0.100.0040.00417.18
8.0.90.0000.00717.05
8.0.80.0030.01317.04
8.0.70.0000.00817.13
8.0.60.0080.00016.89
8.0.50.0000.00717.08
8.0.30.0160.00317.01
8.0.20.0110.01017.40
8.0.10.0040.00417.23
8.0.00.0050.01317.00
7.4.330.0050.00016.72
7.4.320.0030.00316.74
7.4.300.0000.00616.80
7.4.290.0070.00016.75
7.4.280.0070.00016.76
7.4.270.0080.00016.87
7.4.260.0030.00313.54
7.4.250.0040.00416.82
7.4.240.0000.00716.77
7.4.230.0000.00716.95
7.4.220.0060.01216.72
7.4.210.0090.00816.79
7.4.200.0040.00416.88
7.4.190.0030.00516.73
7.4.160.0120.00616.76
7.4.150.0090.00917.40
7.4.140.0100.00917.86
7.4.130.0080.00916.79
7.4.120.0090.01116.75
7.4.110.0120.00616.73
7.4.100.0120.00616.97
7.4.90.0090.00916.57
7.4.80.0080.00819.39
7.4.70.0140.00316.79
7.4.60.0050.01116.81
7.4.50.0060.00316.57
7.4.40.0060.01222.77
7.4.30.0140.00316.75
7.4.00.0070.01015.38
7.3.330.0000.00513.32
7.3.320.0000.00513.28
7.3.310.0030.00316.54
7.3.300.0070.00016.48
7.3.290.0030.01016.52
7.3.280.0090.01216.47
7.3.270.0090.00917.40
7.3.260.0110.00718.24
7.3.250.0080.01316.76
7.3.240.0160.00316.70
7.3.230.0140.00316.86
7.3.210.0130.00316.42
7.3.200.0110.01219.39
7.3.190.0150.00916.82
7.3.180.0120.00816.91
7.3.170.0050.01616.58
7.3.160.0090.00916.50
7.3.120.0060.00914.95
7.3.10.0100.00316.81
7.3.00.0040.01116.74
7.2.330.0100.00916.79
7.2.320.0070.01016.73
7.2.310.0030.01417.05
7.2.300.0100.00716.72
7.2.290.0100.00716.94
7.2.130.0080.00516.81
7.2.120.0100.00317.24
7.2.110.0100.00317.14
7.2.100.0000.01917.33
7.2.90.0030.01017.14
7.2.80.0000.01217.26
7.2.70.0030.00717.32
7.2.60.0100.00317.20
7.2.50.0070.00717.20
7.2.40.0030.00617.17
7.2.30.0070.00417.04
7.2.20.0000.00917.09
7.2.10.0110.00016.94
7.2.00.0050.00718.21
7.1.250.0030.01115.89
7.1.200.0070.01015.62
7.1.100.0000.00918.34
7.1.70.0030.00817.41
7.1.60.0060.01919.17
7.1.50.0230.01334.62
7.1.00.0000.05022.35
7.0.200.0000.00816.96
7.0.140.0030.07322.18
7.0.100.0100.04319.99
7.0.90.0300.05320.00
7.0.80.0270.04020.02
7.0.70.0130.06019.98
7.0.60.0070.04719.99
7.0.50.0100.04020.42
7.0.40.0100.07020.15
7.0.30.0100.04319.95
7.0.20.0070.08020.19
7.0.10.0130.06320.08
7.0.00.0030.04720.04
5.6.280.0000.07721.18
5.6.250.0070.05720.65
5.6.240.0030.06720.60
5.6.230.0030.05720.65
5.6.220.0130.07720.52
5.6.210.0070.05020.77
5.6.200.0030.07021.09
5.6.190.0030.07320.96
5.6.180.0070.06321.14
5.6.170.0070.04321.04
5.6.160.0130.05321.10
5.6.150.0030.04721.11
5.6.140.0070.04021.14
5.6.130.0100.05321.11
5.6.120.0100.05721.03
5.6.110.0030.05321.08
5.6.100.0070.05021.13
5.6.90.0030.06321.05
5.6.80.0070.04320.49
5.6.70.0030.04720.35
5.6.60.0130.04720.36
5.6.50.0100.05320.43
5.6.40.0000.04320.56
5.6.30.0030.06720.39
5.6.20.0030.05720.38
5.6.10.0030.06320.43
5.6.00.0170.05320.39
5.5.380.0100.05320.44
5.5.370.0230.04320.54
5.5.360.0100.04720.38
5.5.350.0100.05020.44
5.5.340.0070.08720.80
5.5.330.0130.04320.84
5.5.320.0070.05020.95
5.5.310.0170.06720.86
5.5.300.0200.04320.80
5.5.290.0170.06320.90
5.5.280.0070.09020.95
5.5.270.0000.06320.84
5.5.260.0100.05020.89
5.5.250.0070.06320.69
5.5.240.0070.05320.24
5.5.230.0100.05720.20
5.5.220.0030.04720.28
5.5.210.0100.07320.04
5.5.200.0070.05320.25
5.5.190.0070.05020.15
5.5.180.0070.08020.01
5.5.160.0070.06020.29
5.5.150.0100.05320.14
5.5.140.0170.03720.28
5.5.130.0030.04020.12
5.5.120.0030.06020.23
5.5.110.0130.06020.25
5.5.100.0030.08020.12
5.5.90.0130.06720.18
5.5.80.0000.05720.00
5.5.70.0130.06720.16
5.5.60.0070.05320.16
5.5.50.0070.06020.16
5.5.40.0000.04720.16
5.5.30.0030.04020.02
5.5.20.0100.05719.98
5.5.10.0070.05020.15
5.5.00.0100.06320.13
5.4.450.0030.04019.20
5.4.440.0100.06719.45
5.4.430.0130.06719.35
5.4.420.0070.04719.46
5.4.410.0070.05019.23
5.4.400.0030.04019.19
5.4.390.0000.06018.95
5.4.380.0130.05018.85
5.4.370.0130.03318.85
5.4.360.0070.05319.05
5.4.350.0070.03319.05
5.4.340.0030.06319.18
5.4.320.0070.06719.14
5.4.310.0030.04319.05
5.4.300.0000.04719.09
5.4.290.0070.04019.03
5.4.280.0130.03019.04
5.4.270.0100.05718.94
5.4.260.0070.06319.20
5.4.250.0030.07318.94
5.4.240.0130.07319.17
5.4.230.0070.05019.18
5.4.220.0070.08318.90
5.4.210.0100.04719.18
5.4.200.0030.04019.04
5.4.190.0070.04018.89
5.4.180.0100.05019.11
5.4.170.0030.05319.15
5.4.160.0070.04318.96
5.4.150.0130.06018.85
5.4.140.0100.05316.47
5.4.130.0000.04316.50
5.4.120.0000.04316.50
5.4.110.0070.04316.45
5.4.100.0030.04016.48
5.4.90.0100.03316.49
5.4.80.0070.06016.55
5.4.70.0070.05016.54
5.4.60.0100.05716.43
5.4.50.0000.04016.26
5.4.40.0070.04016.46
5.4.30.0000.07316.33
5.4.20.0100.04016.48
5.4.10.0030.04316.33
5.4.00.0030.04315.86
5.3.290.0030.04714.59
5.3.280.0030.08014.73
5.3.270.0000.07314.66
5.3.260.0170.06314.64
5.3.250.0000.04314.64
5.3.240.0000.05714.67
5.3.230.0030.04714.58
5.3.220.0070.05714.63
5.3.210.0070.05714.54
5.3.200.0070.04314.62
5.3.190.0070.04314.70
5.3.180.0030.06314.62
5.3.170.0000.04314.57
5.3.160.0030.07314.67
5.3.150.0100.04714.54
5.3.140.0030.04014.64
5.3.130.0000.06714.60
5.3.120.0070.07014.47
5.3.110.0100.04014.53
5.3.100.0030.04014.01
5.3.90.0030.07013.95
5.3.80.0030.04314.13
5.3.70.0000.04314.14
5.3.60.0070.05014.02
5.3.50.0070.04314.01
5.3.40.0030.06013.95
5.3.30.0070.05014.01
5.3.20.0030.05713.67
5.3.10.0030.04313.80
5.3.00.0070.06313.73
5.2.170.0000.04013.67
5.2.160.0030.03013.67
5.2.150.0000.03713.67
5.2.140.0030.04313.67
5.2.130.0100.04313.67
5.2.120.0030.04713.67
5.2.110.0000.04313.67
5.2.100.0130.03713.67
5.2.90.0030.03713.67
5.2.80.0030.04013.67
5.2.70.0000.04013.67
5.2.60.0070.04713.67
5.2.50.0070.03313.67
5.2.40.0130.03313.67
5.2.30.0070.04713.67
5.2.20.0070.05013.67
5.2.10.0070.02313.67
5.2.00.0100.02713.67
5.1.60.0000.04713.67
5.1.50.0070.02313.67
5.1.40.0030.04013.67
5.1.30.0030.03013.67
5.1.20.0030.03013.67
5.1.10.0030.03313.67
5.1.00.0070.03013.67
5.0.50.0000.02713.67
5.0.40.0030.03313.67
5.0.30.0130.03013.67
5.0.20.0030.04013.67
5.0.10.0000.02713.67
5.0.00.0100.03313.67
4.4.90.0000.02313.67
4.4.80.0000.03313.67
4.4.70.0030.02013.67
4.4.60.0000.02013.67
4.4.50.0000.01713.67
4.4.40.0030.03313.67
4.4.30.0030.02713.67
4.4.20.0030.02313.67
4.4.10.0070.01313.67
4.4.00.0000.04713.67
4.3.110.0000.02713.67
4.3.100.0000.02313.67
4.3.90.0000.02313.67
4.3.80.0000.04713.67
4.3.70.0030.02013.67
4.3.60.0000.02313.67
4.3.50.0000.02313.67
4.3.40.0030.04313.67
4.3.30.0000.02313.67
4.3.20.0070.01713.67
4.3.10.0000.02713.67
4.3.00.0030.02713.67

preferences:
34.76 ms | 401 KiB | 5 Q