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; } $result = []; foreach ($map as $component => $index) { 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://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.0070.01018.80
8.3.50.0160.00321.14
8.3.40.0120.00618.90
8.3.30.0120.00320.13
8.3.20.0080.00020.78
8.3.10.0000.00821.14
8.3.00.0040.00422.39
8.2.180.0070.01517.00
8.2.170.0070.00722.96
8.2.160.0100.00320.52
8.2.150.0050.00324.18
8.2.140.0060.00624.66
8.2.130.0040.00426.16
8.2.120.0000.00821.18
8.2.110.0070.00420.43
8.2.100.0060.00618.10
8.2.90.0050.00318.16
8.2.80.0060.00317.97
8.2.70.0040.00417.88
8.2.60.0080.00017.92
8.2.50.0040.00418.07
8.2.40.0040.00418.22
8.2.30.0050.00219.50
8.2.20.0040.00417.78
8.2.10.0000.00818.11
8.2.00.0000.00818.00
8.1.280.0070.01725.92
8.1.270.0100.00023.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0040.00421.96
8.1.230.0100.00321.02
8.1.220.0000.00817.91
8.1.210.0030.00819.03
8.1.200.0060.00317.47
8.1.190.0060.00317.66
8.1.180.0030.00618.10
8.1.170.0040.00418.76
8.1.160.0020.00518.83
8.1.150.0050.00218.70
8.1.140.0040.00417.69
8.1.130.0040.00417.80
8.1.120.0040.00417.64
8.1.110.0000.00717.64
8.1.100.0070.00017.64
8.1.90.0000.00817.56
8.1.80.0040.00417.67
8.1.70.0000.00717.61
8.1.60.0050.00517.80
8.1.50.0040.00417.59
8.1.40.0050.00517.73
8.1.30.0000.00817.71
8.1.20.0000.00817.82
8.1.10.0040.00417.77
8.1.00.0000.00817.60
8.0.300.0040.00420.29
8.0.290.0070.00017.17
8.0.280.0030.00318.55
8.0.270.0040.00417.28
8.0.260.0030.00317.05
8.0.250.0040.00417.10
8.0.240.0060.00317.18
8.0.230.0000.00717.26
8.0.220.0000.00717.02
8.0.210.0040.00417.10
8.0.200.0000.00617.06
8.0.190.0040.00417.20
8.0.180.0070.00017.07
8.0.170.0030.00317.18
8.0.160.0040.00417.14
8.0.150.0050.00217.10
8.0.140.0070.00017.13
8.0.130.0030.00313.57
8.0.120.0050.00317.07
8.0.110.0080.00017.18
8.0.100.0080.00017.00
8.0.90.0050.00217.09
8.0.80.0060.00917.14
8.0.70.0030.00616.99
8.0.60.0040.00417.01
8.0.50.0040.00417.04
8.0.30.0120.00717.26
8.0.20.0100.00917.40
8.0.10.0040.00417.10
8.0.00.0060.01616.88
7.4.330.0020.00216.86
7.4.320.0030.00316.70
7.4.300.0000.00716.68
7.4.290.0050.00316.80
7.4.280.0000.00716.76
7.4.270.0030.00316.65
7.4.260.0050.00013.48
7.4.250.0000.00816.77
7.4.240.0040.00416.78
7.4.230.0030.00316.89
7.4.220.0090.01316.86
7.4.210.0090.00716.79
7.4.200.0030.00316.92
7.4.190.0040.00416.98
7.4.160.0100.00616.89
7.4.150.0040.01917.40
7.4.140.0090.00917.86
7.4.130.0080.01016.85
7.4.120.0100.00716.81
7.4.110.0100.01016.65
7.4.100.0160.00616.72
7.4.90.0090.01517.09
7.4.80.0190.00619.39
7.4.70.0060.01216.84
7.4.60.0030.01716.73
7.4.50.0060.00316.70
7.4.40.0070.01022.77
7.4.30.0070.01416.73
7.4.00.0080.00615.09
7.3.330.0000.00513.54
7.3.320.0030.00313.48
7.3.310.0040.00416.39
7.3.300.0000.00716.38
7.3.290.0100.01016.53
7.3.280.0090.00616.56
7.3.270.0100.00917.40
7.3.260.0110.01018.24
7.3.250.0080.01016.62
7.3.240.0100.00716.51
7.3.230.0040.01316.83
7.3.210.0120.00416.62
7.3.200.0120.00919.39
7.3.190.0070.01016.95
7.3.180.0040.01216.86
7.3.170.0060.01016.67
7.3.160.0140.00316.70
7.3.120.0030.01015.20
7.3.00.0080.00816.86
7.2.330.0140.00416.93
7.2.320.0130.01016.89
7.2.310.0150.00316.89
7.2.300.0070.01016.86
7.2.290.0100.00716.79
7.2.130.0110.00417.05
7.2.120.0050.01117.05
7.2.110.0100.00316.99
7.2.100.0050.01417.17
7.2.90.0070.00417.07
7.2.80.0070.01416.94
7.2.70.0160.00317.24
7.2.60.0120.00417.25
7.2.50.0120.00917.05
7.2.40.0070.01417.17
7.2.30.0070.01017.35
7.2.20.0070.00716.88
7.2.10.0040.01217.08
7.2.00.0020.01318.29
7.1.250.0090.00016.04
7.1.240.0040.01215.86
7.1.230.0120.00615.59
7.1.220.0060.00915.84
7.1.210.0110.00315.69
7.1.200.0050.00715.98
7.1.190.0110.00315.75
7.1.180.0060.00616.00
7.1.170.0080.00615.98
7.1.160.0100.00715.71
7.1.150.0080.00516.02
7.1.140.0090.00315.91
7.1.130.0150.00415.92
7.1.120.0030.01415.64
7.1.110.0070.00715.67
7.1.100.0060.00716.78
7.1.90.0030.01316.00
7.1.80.0050.00815.54
7.1.70.0080.00216.47
7.1.60.0050.01217.38
7.1.50.0140.01325.31
7.1.40.0070.01015.96
7.1.30.0040.00916.06
7.1.20.0110.00715.84
7.1.10.0040.01115.59
7.1.00.0050.02219.23
7.0.330.0110.00315.64
7.0.320.0060.00615.49
7.0.310.0120.00615.41
7.0.300.0070.01015.59
7.0.290.0060.00615.68
7.0.280.0170.00315.39
7.0.270.0120.00615.72
7.0.260.0090.00915.50
7.0.250.0100.00315.57
7.0.240.0090.00615.57
7.0.230.0110.00515.32
7.0.220.0040.00715.50
7.0.210.0100.00315.29
7.0.200.0030.00716.22
7.0.190.0060.00915.51
7.0.180.0030.00915.52
7.0.170.0040.00815.66
7.0.160.0030.01015.58
7.0.150.0060.00615.41
7.0.140.0030.04118.73
7.0.130.0060.00615.64
7.0.120.0060.00615.54
7.0.110.0070.01015.30
7.0.100.0060.01015.35
7.0.90.0050.04517.93
7.0.80.0110.03817.80
7.0.70.0080.04817.54
7.0.60.0090.02817.63
7.0.50.0130.03817.77
7.0.40.0100.03016.71
7.0.30.0050.04616.83
7.0.20.0170.03316.65
7.0.10.0070.03216.93
7.0.00.0100.02316.94
5.6.380.0060.01014.48
5.6.370.0030.01014.70
5.6.360.0070.00414.30
5.6.350.0090.00614.27
5.6.340.0030.01314.46
5.6.330.0040.00414.65
5.6.320.0030.01014.60
5.6.310.0030.01014.83
5.6.300.0060.00914.29
5.6.290.0050.00514.27
5.6.280.0050.04017.80
5.6.270.0030.01514.33
5.6.260.0030.01014.13
5.6.250.0080.00414.57
5.6.240.0060.00614.33
5.6.230.0040.04517.56
5.6.220.0080.02317.60
5.6.210.0120.04017.39
5.6.200.0130.04317.53
5.6.190.0060.04117.48
5.6.180.0080.03717.59
5.6.170.0070.04217.82
5.6.160.0060.02317.74
5.6.150.0080.04017.83
5.6.140.0080.04117.81
5.6.130.0100.02517.81
5.6.120.0050.04317.70
5.6.110.0090.03317.79
5.6.100.0020.04817.76
5.6.90.0080.03317.64
5.6.80.0080.02817.38
5.6.70.0100.04017.25
5.6.60.0030.04617.42
5.6.50.0050.02317.26
5.6.40.0080.03117.51
5.6.30.0080.04217.41
5.6.20.0030.03817.33
5.6.10.0070.04417.43
5.6.00.0080.02517.36
5.5.380.0030.00811.36
5.5.370.0050.04415.63
5.5.360.0040.03815.77
5.5.350.0090.03415.84
5.5.340.0090.03216.13
5.5.330.0110.02316.09
5.5.320.0100.04216.02
5.5.310.0080.04316.11
5.5.300.0100.02316.05
5.5.290.0050.03216.05
5.5.280.0070.04316.15
5.5.270.0060.03216.02
5.5.260.0060.04716.13
5.5.250.0050.04715.79
5.5.240.0010.03415.73
5.5.230.0020.02915.62
5.5.220.0070.02815.74
5.5.210.0030.03015.79
5.5.200.0040.02315.72
5.5.190.0080.04515.51
5.5.180.0030.02515.75
5.5.170.0040.01111.37
5.5.160.0130.02515.54
5.5.150.0100.02615.49
5.5.140.0020.03815.71
5.5.130.0090.03815.63
5.5.120.0050.04315.71
5.5.110.0110.03815.63
5.5.100.0070.03015.77
5.5.90.0040.02315.55
5.5.80.0100.04315.65
5.5.70.0060.04315.51
5.5.60.0130.03515.44
5.5.50.0090.02515.58
5.5.40.0080.04015.65
5.5.30.0050.04115.33
5.5.20.0070.03615.65
5.5.10.0100.03815.49
5.5.00.0050.02815.63
5.4.450.0090.04015.20
5.4.440.0050.04615.29
5.4.430.0050.03115.24
5.4.420.0080.04115.31
5.4.410.0080.02815.32
5.4.400.0050.03415.15
5.4.390.0090.03915.09
5.4.380.0070.02615.08
5.4.370.0070.03115.07
5.4.360.0020.02515.02
5.4.350.0120.02815.19
5.4.340.0050.02315.06
5.4.330.0110.00011.21
5.4.320.0030.04215.17
5.4.310.0090.04014.88
5.4.300.0120.03914.83
5.4.290.0080.04015.07
5.4.280.0020.04715.12
5.4.270.0040.03215.04
5.4.260.0110.03915.19
5.4.250.0100.02015.11
5.4.240.0080.02715.01
5.4.230.0050.03815.07
5.4.220.0100.04115.03
5.4.210.0060.03914.97
5.4.200.0110.03314.92
5.4.190.0070.02314.86
5.4.180.0030.04515.01
5.4.170.0100.02515.10
5.4.160.0030.03515.15
5.4.150.0050.02515.11
5.4.140.0070.03513.60
5.4.130.0080.03713.78
5.4.120.0040.03913.77
5.4.110.0110.03213.64
5.4.100.0060.02313.70
5.4.90.0040.02513.71
5.4.80.0080.02413.62
5.4.70.0070.03513.82
5.4.60.0050.02613.85
5.4.50.0080.03013.72
5.4.40.0070.03813.62
5.4.30.0050.03713.65
5.4.20.0030.04213.76
5.4.10.0070.03713.59
5.4.00.0050.03913.39
5.3.290.0080.04112.49
5.3.280.0100.03712.39
5.3.270.0030.03612.35
5.3.260.0030.03712.54
5.3.250.0100.03712.48
5.3.240.0050.03312.35
5.3.230.0050.02912.36
5.3.220.0050.03912.41
5.3.210.0070.03712.45
5.3.200.0080.03012.42
5.3.190.0020.02512.44
5.3.180.0100.03512.58
5.3.170.0050.03612.47
5.3.160.0070.01912.54
5.3.150.0050.03712.46
5.3.140.0070.03712.36
5.3.130.0050.03812.29
5.3.120.0030.03012.44
5.3.110.0050.03812.52
5.3.100.0040.03112.17
5.3.90.0050.02812.21
5.3.80.0050.02012.22
5.3.70.0050.02412.10
5.3.60.0060.03612.09
5.3.50.0030.04012.15
5.3.40.0060.03911.94
5.3.30.0050.04411.90
5.3.20.0030.04012.00
5.3.10.0060.03011.86
5.3.00.0040.03111.95
5.2.170.0030.03111.78
5.2.160.0070.03211.78
5.2.150.0050.03211.78
5.2.140.0050.03311.78
5.2.130.0020.03711.78
5.2.120.0050.03311.78
5.2.110.0020.03411.78
5.2.100.0030.03311.78
5.2.90.0070.02811.78
5.2.80.0050.03311.78
5.2.70.0070.02811.78
5.2.60.0080.02311.78
5.2.50.0030.03611.78
5.2.40.0000.03611.78
5.2.30.0050.03011.78
5.2.20.0020.02911.78
5.2.10.0050.02311.78
5.2.00.0050.03011.78
5.1.60.0040.02811.78
5.1.50.0050.02911.78
5.1.40.0030.02811.78
5.1.30.0050.01911.78
5.1.20.0120.02211.78
5.1.10.0030.02911.78
5.1.00.0040.02811.78
5.0.50.0020.02211.78
5.0.40.0020.01511.78
5.0.30.0040.03211.78
5.0.20.0060.01811.78
5.0.10.0020.01711.78
5.0.00.0070.03011.78
4.4.90.0000.02011.78
4.4.80.0000.02011.78
4.4.70.0030.02011.78
4.4.60.0000.01411.78
4.4.50.0000.01911.78
4.4.40.0000.02311.78
4.4.30.0020.01811.78
4.4.20.0020.01811.78
4.4.10.0010.02011.78
4.4.00.0010.02111.78
4.3.110.0020.02011.78
4.3.100.0040.01711.78
4.3.90.0020.01811.78
4.3.80.0020.02511.78
4.3.70.0050.00911.78
4.3.60.0030.01011.78
4.3.50.0000.01911.78
4.3.40.0050.02311.78
4.3.30.0030.02011.78
4.3.20.0000.02111.78
4.3.10.0020.02011.78
4.3.00.0030.02011.78

preferences:
42.91 ms | 401 KiB | 5 Q