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 = [ 'scheme' => 1, 'user' => 2, 'pass' => 3, 'host' => 4, 'port' => 5, 'path' => 6, 'query' => 7, 'fragment' => 8 ]; 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.0140.00718.63
8.3.50.0120.00421.27
8.3.40.0140.00719.17
8.3.30.0140.00020.30
8.3.20.0060.00320.73
8.3.10.0030.00521.22
8.3.00.0040.00422.43
8.2.180.0120.00916.88
8.2.170.0110.01122.96
8.2.160.0070.00720.43
8.2.150.0030.00524.18
8.2.140.0030.00624.66
8.2.130.0000.00726.16
8.2.120.0040.00421.04
8.2.110.0030.00619.32
8.2.100.0110.00018.03
8.2.90.0090.00019.24
8.2.80.0050.00317.97
8.2.70.0090.00017.59
8.2.60.0000.00818.04
8.2.50.0000.00818.07
8.2.40.0030.00618.16
8.2.30.0000.00819.54
8.2.20.0050.00317.94
8.2.10.0040.00417.99
8.2.00.0090.00017.92
8.1.280.0150.00425.92
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0060.00323.88
8.1.230.0090.00321.11
8.1.220.0050.00318.77
8.1.210.0050.00319.12
8.1.200.0040.00717.60
8.1.190.0000.00817.66
8.1.180.0000.00818.10
8.1.170.0030.00618.71
8.1.160.0070.00018.93
8.1.150.0040.00418.88
8.1.140.0040.00417.55
8.1.130.0040.00417.90
8.1.120.0030.00517.57
8.1.110.0050.00317.53
8.1.100.0040.00417.55
8.1.90.0000.00817.55
8.1.80.0050.00217.62
8.1.70.0000.00717.52
8.1.60.0060.00317.82
8.1.50.0040.00717.63
8.1.40.0030.00617.57
8.1.30.0030.00617.86
8.1.20.0050.00317.88
8.1.10.0040.00417.64
8.1.00.0030.00617.59
8.0.300.0000.00820.16
8.0.290.0040.00417.05
8.0.280.0070.00018.51
8.0.270.0030.00317.32
8.0.260.0000.00716.95
8.0.250.0040.00417.12
8.0.240.0000.00817.09
8.0.230.0050.00217.09
8.0.220.0000.00717.06
8.0.210.0030.00317.16
8.0.200.0030.00317.12
8.0.190.0000.00717.21
8.0.180.0070.00017.14
8.0.170.0040.00417.09
8.0.160.0000.00717.13
8.0.150.0050.00317.13
8.0.140.0040.00417.12
8.0.130.0040.00413.56
8.0.120.0030.00517.11
8.0.110.0070.00017.08
8.0.100.0030.00517.04
8.0.90.0040.00417.24
8.0.80.0180.00317.21
8.0.70.0000.00817.21
8.0.60.0000.00816.98
8.0.50.0050.00317.03
8.0.30.0100.01117.34
8.0.20.0140.00917.51
8.0.10.0040.00417.10
8.0.00.0110.00917.13
7.4.330.0030.00316.82
7.4.320.0050.00316.79
7.4.300.0060.00016.90
7.4.290.0070.00016.92
7.4.280.0000.00716.80
7.4.270.0080.00016.76
7.4.260.0050.00013.46
7.4.250.0030.00516.83
7.4.240.0040.00416.72
7.4.230.0050.00316.87
7.4.220.0120.00916.80
7.4.210.0060.01116.78
7.4.200.0000.00716.89
7.4.190.0030.00316.95
7.4.160.0100.00716.67
7.4.150.0090.00917.40
7.4.140.0090.00917.86
7.4.130.0100.00816.75
7.4.120.0110.00616.86
7.4.110.0070.01016.88
7.4.100.0090.00916.70
7.4.90.0170.00016.65
7.4.80.0130.00819.39
7.4.70.0000.01817.00
7.4.60.0130.00716.63
7.4.50.0060.00316.64
7.4.40.0040.01522.77
7.4.30.0080.00816.76
7.4.00.0030.01215.38
7.3.330.0030.00213.31
7.3.320.0030.00313.39
7.3.310.0070.00016.56
7.3.300.0030.00316.55
7.3.290.0060.01316.56
7.3.280.0110.00716.54
7.3.270.0070.01717.40
7.3.260.0090.01118.24
7.3.250.0070.01416.65
7.3.240.0040.01316.63
7.3.230.0100.00716.86
7.3.210.0080.00816.56
7.3.200.0100.01019.39
7.3.190.0120.00916.91
7.3.180.0110.01016.64
7.3.170.0070.01016.70
7.3.160.0130.00316.66
7.3.120.0110.00015.29
7.2.330.0070.01116.96
7.2.320.0070.01716.95
7.2.310.0310.02916.94
7.2.300.0060.01016.73
7.2.290.0140.00816.91
7.2.80.0000.01016.89
7.2.60.0080.00417.30
7.2.00.0070.00719.39
7.1.200.0070.00315.73
7.1.100.0000.01118.23
7.1.70.0000.00717.36
7.1.60.0060.01919.17
7.1.50.0220.01334.98
7.1.00.0000.03722.57
7.0.200.0000.00817.08
7.0.140.0000.07722.18
7.0.100.0130.07720.03
7.0.90.0000.08320.00
7.0.80.0070.08720.06
7.0.70.0330.07319.98
7.0.60.0400.07720.00
7.0.50.0500.07020.33
7.0.40.0030.08720.07
7.0.30.0170.07720.14
7.0.20.0130.07720.15
7.0.10.0070.08320.05
7.0.00.0170.07720.13
5.6.280.0070.07021.14
5.6.250.0030.04720.69
5.6.240.0130.07720.54
5.6.230.0070.08020.59
5.6.220.0070.08320.55
5.6.210.0030.05320.58
5.6.200.0130.07321.11
5.6.190.0100.08321.03
5.6.180.0030.07320.96
5.6.170.0100.07321.09
5.6.160.0170.06720.96
5.6.150.0100.07021.05
5.6.140.0100.07720.94
5.6.130.0170.06320.96
5.6.120.0030.06021.00
5.6.110.0170.07720.91
5.6.100.0130.07320.98
5.6.90.0130.07021.05
5.6.80.0030.08020.42
5.6.70.0170.06320.41
5.6.60.0070.05020.41
5.6.50.0070.08020.38
5.6.40.0230.03320.44
5.6.30.0170.06720.39
5.6.20.0130.07720.31
5.6.10.0130.06720.32
5.6.00.0030.07720.45
5.5.380.0100.08320.37
5.5.370.0130.06320.39
5.5.360.0070.09320.35
5.5.350.0070.08720.45
5.5.340.0130.06720.86
5.5.330.0070.07320.83
5.5.320.0130.07020.95
5.5.310.0170.07320.88
5.5.300.0030.06720.79
5.5.290.0130.08020.88
5.5.280.0030.07320.93
5.5.270.0070.08320.90
5.5.260.0070.06720.90
5.5.250.0100.04720.58
5.5.240.0070.04020.27
5.5.230.0070.08020.28
5.5.220.0030.06320.33
5.5.210.0130.07320.26
5.5.200.0130.07320.27
5.5.190.0000.08320.13
5.5.180.0070.08020.27
5.5.160.0070.08020.24
5.5.150.0070.08020.21
5.5.140.0100.08020.26
5.5.130.0100.07020.28
5.5.120.0070.07720.21
5.5.110.0030.08320.15
5.5.100.0030.04720.07
5.5.90.0030.07320.17
5.5.80.0130.04020.12
5.5.70.0030.07720.14
5.5.60.0030.04320.08
5.5.50.0030.08020.14
5.5.40.0070.07320.05
5.5.30.0030.06720.16
5.5.20.0100.04320.13
5.5.10.0030.08319.98
5.5.00.0100.04320.13
5.4.450.0100.07719.24
5.4.440.0030.07719.57
5.4.430.0100.07719.40
5.4.420.0100.05319.37
5.4.410.0100.07019.27
5.4.400.0030.04719.10
5.4.390.0130.07319.14
5.4.380.0070.07319.13
5.4.370.0070.08018.93
5.4.360.0130.06319.14
5.4.350.0070.08019.09
5.4.340.0100.06718.88
5.4.320.0200.06719.19
5.4.310.0100.07319.05
5.4.300.0030.07719.04
5.4.290.0170.06319.14
5.4.280.0100.07019.05
5.4.270.0070.07319.23
5.4.260.0070.03718.85
5.4.250.0070.07319.18
5.4.240.0100.06318.94
5.4.230.0100.07719.13
5.4.220.0030.08019.16
5.4.210.0000.06319.23
5.4.200.0070.06719.04
5.4.190.0070.07719.04
5.4.180.0170.07019.15
5.4.170.0130.06719.08
5.4.160.0030.07318.84
5.4.150.0070.06718.84
5.4.140.0030.07716.52
5.4.130.0070.04016.48
5.4.120.0100.07016.51
5.4.110.0030.05016.57
5.4.100.0100.05016.48
5.4.90.0070.07016.38
5.4.80.0070.07016.44
5.4.70.0000.07016.51
5.4.60.0070.06316.44
5.4.50.0130.06716.41
5.4.40.0030.06016.41
5.4.30.0100.07016.48
5.4.20.0030.07316.40
5.4.10.0130.05316.36
5.4.00.0100.06315.89
5.3.290.0130.06714.64
5.3.280.0100.07314.54
5.3.270.0070.04314.73
5.3.260.0030.08014.64
5.3.250.0030.05714.67
5.3.240.0130.05714.65
5.3.230.0100.06714.65
5.3.220.0130.07314.69
5.3.210.0100.07014.52
5.3.200.0030.07714.70
5.3.190.0070.03314.55
5.3.180.0170.06714.66
5.3.170.0030.07014.55
5.3.160.0100.04314.68
5.3.150.0070.07714.54
5.3.140.0070.04314.55
5.3.130.0130.06314.58
5.3.120.0070.07014.61
5.3.110.0000.07014.61
5.3.100.0070.07314.15
5.3.90.0070.07314.16
5.3.80.0070.08013.96
5.3.70.0070.07013.91
5.3.60.0070.06314.06
5.3.50.0130.06013.93
5.3.40.0070.05313.95
5.3.30.0030.04014.04
5.3.20.0070.07313.72
5.3.10.0030.07013.72
5.3.00.0130.06313.57
5.2.170.0100.05711.17
5.2.160.0030.03711.07
5.2.150.0000.06310.99
5.2.140.0130.04710.99
5.2.130.0030.06311.14
5.2.120.0000.06011.09
5.2.110.0100.05710.96
5.2.100.0100.04310.97
5.2.90.0100.03010.93
5.2.80.0030.06310.96
5.2.70.0030.06311.16
5.2.60.0070.04310.87
5.2.50.0030.06311.02
5.2.40.0070.03010.99
5.2.30.0000.03710.84
5.2.20.0000.06310.91
5.2.10.0030.05310.77
5.2.00.0030.06710.77
5.1.60.0030.05310.00
5.1.50.0030.03710.03
5.1.40.0070.0439.98
5.1.30.0030.06310.20
5.1.20.0070.04310.27
5.1.10.0100.04310.04
5.1.00.0030.03010.10
5.0.50.0000.0478.54
5.0.40.0030.0238.41
5.0.30.0030.0578.10
5.0.20.0070.0408.27
5.0.10.0100.0408.27
5.0.00.0070.0578.16
4.4.90.0030.0308.04
4.4.80.0030.0278.04
4.4.70.0030.0378.04
4.4.60.0030.0338.04
4.4.50.0100.0208.04
4.4.40.0000.0578.04
4.4.30.0000.0338.04
4.4.20.0070.0278.04
4.4.10.0070.0308.04
4.4.00.0000.0478.04
4.3.110.0030.0378.04
4.3.100.0000.0338.04
4.3.90.0070.0308.04
4.3.80.0000.0578.04
4.3.70.0100.0278.04
4.3.60.0070.0308.04
4.3.50.0030.0338.04
4.3.40.0070.0478.04
4.3.30.0030.0378.04
4.3.20.0000.0278.04
4.3.10.0000.0408.04
4.3.00.0030.0278.04

preferences:
46.48 ms | 401 KiB | 5 Q