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 ($matches[$index] !== '') { $result[$component] = $index === 5 ? (int) $matches[$index] : $matches[$index]; } } return $result; } var_dump(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.40.0120.00318.83
8.3.30.0100.00320.17
8.3.20.0050.00318.88
8.3.10.0000.00821.23
8.3.00.0000.00822.39
8.2.170.0150.00422.96
8.2.160.0070.00720.57
8.2.150.0000.00824.18
8.2.140.0000.00824.66
8.2.130.0000.00826.16
8.2.120.0050.00321.21
8.2.110.0060.00319.33
8.2.100.0090.00317.90
8.2.90.0000.00819.26
8.2.80.0040.00418.05
8.2.70.0060.00317.59
8.2.60.0040.00418.04
8.2.50.0080.00018.07
8.2.40.0050.00318.16
8.2.30.0000.00719.37
8.2.20.0080.00017.96
8.2.10.0070.00018.02
8.2.00.0030.00518.02
8.1.270.0040.00423.99
8.1.260.0000.00826.35
8.1.250.0000.00828.09
8.1.240.0000.00923.79
8.1.230.0060.00620.93
8.1.220.0040.00418.77
8.1.210.0050.00319.15
8.1.200.0100.00017.48
8.1.190.0040.00417.53
8.1.180.0050.00318.10
8.1.170.0030.00518.81
8.1.160.0040.00418.95
8.1.150.0040.00418.86
8.1.140.0040.00417.58
8.1.130.0050.00217.78
8.1.120.0050.00217.55
8.1.110.0040.00417.52
8.1.100.0000.00717.54
8.1.90.0040.00417.56
8.1.80.0040.00417.69
8.1.70.0000.00717.63
8.1.60.0050.00317.72
8.1.50.0000.00717.68
8.1.40.0040.00417.60
8.1.30.0000.00717.84
8.1.20.0050.00317.78
8.1.10.0060.00317.74
8.1.00.0000.00817.60
8.0.300.0040.00420.10
8.0.290.0060.00317.28
8.0.280.0000.00718.42
8.0.270.0000.00717.18
8.0.260.0000.00716.99
8.0.250.0000.00717.03
8.0.240.0040.00417.13
8.0.230.0030.00617.10
8.0.220.0020.00517.08
8.0.210.0000.00717.06
8.0.200.0040.00417.12
8.0.190.0000.00717.06
8.0.180.0070.00317.06
8.0.170.0050.00316.98
8.0.160.0000.00717.05
8.0.150.0040.00417.00
8.0.140.0040.00417.02
8.0.130.0000.00613.43
8.0.120.0030.00616.99
8.0.110.0040.00417.06
8.0.100.0000.00817.07
8.0.90.0040.00416.95
8.0.80.0040.01217.14
8.0.70.0080.00017.05
8.0.60.0050.00316.94
8.0.50.0030.00516.98
8.0.30.0120.00617.35
8.0.20.0050.01417.50
8.0.10.0070.00017.08
8.0.00.0100.00917.09
7.4.330.0020.00216.88
7.4.320.0000.00716.76
7.4.300.0070.00016.77
7.4.290.0080.00016.74
7.4.280.0040.00416.75
7.4.270.0030.00316.74
7.4.260.0030.00313.44
7.4.250.0050.00216.61
7.4.240.0020.00516.74
7.4.230.0070.00016.76
7.4.220.0090.00916.91
7.4.210.0090.00716.72
7.4.200.0030.00316.92
7.4.190.0040.00416.74
7.4.160.0060.00916.95
7.4.150.0170.00717.40
7.4.140.0110.00917.86
7.4.130.0060.01116.80
7.4.120.0090.00916.66
7.4.110.0090.01216.61
7.4.100.0130.00716.75
7.4.90.0030.01416.78
7.4.80.0100.01419.39
7.4.70.0080.01216.63
7.4.60.0100.01016.69
7.4.50.0000.00816.77
7.4.40.0100.00622.77
7.4.30.0130.01016.74
7.4.00.0060.01115.11
7.3.330.0060.00013.60
7.3.320.0000.00613.32
7.3.310.0000.00716.57
7.3.300.0030.00316.55
7.3.290.0040.01116.46
7.3.280.0090.00816.56
7.3.270.0170.03717.40
7.3.260.0110.00718.24
7.3.250.0090.01316.70
7.3.240.0030.01416.88
7.3.230.0060.01616.50
7.3.210.0100.00716.69
7.3.200.0090.01219.39
7.3.190.0060.01616.80
7.3.180.0090.00616.63
7.3.170.0120.00316.63
7.3.160.0030.02116.88
7.3.120.0040.01415.15
7.3.110.0110.00714.93
7.3.100.0090.00715.07
7.3.90.0050.00814.86
7.3.80.0070.00815.18
7.3.70.0050.00515.16
7.3.60.0070.00715.16
7.3.50.0050.00615.19
7.3.40.0040.00914.88
7.3.30.0040.01114.99
7.3.20.0040.00916.72
7.3.10.0030.01216.79
7.3.00.0070.00616.82
7.2.330.0160.00616.74
7.2.320.0120.00917.01
7.2.310.0070.01016.87
7.2.300.0040.01416.88
7.2.290.0100.00717.01
7.2.250.0070.00915.24
7.2.240.0080.00815.28
7.2.230.0100.00715.38
7.2.220.0050.00815.32
7.2.210.0070.00715.24
7.2.200.0040.00915.45
7.2.190.0070.00715.14
7.2.180.0060.00415.10
7.2.170.0040.00915.19
7.2.110.0040.01116.87
7.2.00.0100.00319.68
7.1.330.0020.01315.92
7.1.320.0070.00516.19
7.1.310.0060.00816.07
7.1.300.0040.00415.71
7.1.290.0040.01016.14
7.1.280.0090.00715.98
7.1.270.0030.00616.10
7.1.260.0080.00715.95
7.1.100.0030.01018.48
7.1.70.0040.00717.38
7.1.60.0100.01319.17
7.1.50.0270.01335.11
7.1.00.0000.03722.49
7.0.200.0000.00717.11
7.0.140.0030.07722.09
7.0.100.0070.04019.88
7.0.90.0030.04019.96
7.0.80.0070.04320.12
7.0.70.0070.04719.98
7.0.60.0030.05020.13
7.0.50.0030.03720.34
7.0.40.0030.04319.95
7.0.30.0070.04720.11
7.0.20.0100.04320.11
7.0.10.0000.04320.07
7.0.00.0030.06720.05
5.6.280.0000.07721.10
5.6.250.0030.04320.59
5.6.240.0000.04720.52
5.6.230.0030.04320.60
5.6.220.0000.04720.68
5.6.210.0100.03720.50
5.6.200.0030.05021.18
5.6.190.0070.04320.96
5.6.180.0000.04721.05
5.6.170.0030.04321.02
5.6.160.0070.04021.02
5.6.150.0070.04021.07
5.6.140.0070.05721.11
5.6.130.0000.04721.06
5.6.120.0030.08321.06
5.6.110.0000.09021.01
5.6.100.0030.07021.02
5.6.90.0070.04721.06
5.6.80.0100.06320.40
5.6.70.0000.09020.34
5.6.60.0030.08020.49
5.6.50.0000.05020.38
5.6.40.0030.06720.44
5.6.30.0030.08720.32
5.6.20.0100.07320.42
5.6.10.0030.05720.31
5.6.00.0030.06320.31
5.5.380.0070.03720.42
5.5.370.0030.04020.46
5.5.360.0100.03320.37
5.5.350.0100.03020.43
5.5.340.0070.04020.91
5.5.330.0070.04020.89
5.5.320.0100.06020.89
5.5.310.0000.04320.84
5.5.300.0030.04320.92
5.5.290.0030.05020.90
5.5.280.0130.07720.89
5.5.270.0070.06720.90
5.5.260.0000.05320.80
5.5.250.0070.07720.55
5.5.240.0070.04320.02
5.5.230.0100.04020.16
5.5.220.0070.08020.27
5.5.210.0000.07320.21
5.5.200.0070.05720.24
5.5.190.0030.07020.26
5.5.180.0030.04720.19
5.5.160.0170.03720.23
5.5.150.0070.04720.13
5.5.140.0170.06320.27
5.5.130.0000.05320.27
5.5.120.0070.05720.18
5.5.110.0000.05020.20
5.5.100.0100.07720.06
5.5.90.0070.04020.08
5.5.80.0000.04320.16
5.5.70.0000.08019.94
5.5.60.0100.05720.07
5.5.50.0030.05320.06
5.5.40.0000.06720.06
5.5.30.0100.04020.10
5.5.20.0170.06720.06
5.5.10.0030.07320.12
5.5.00.0170.07320.04
5.4.450.0000.04719.46
5.4.440.0130.07019.37
5.4.430.0030.07719.17
5.4.420.0070.04319.46
5.4.410.0070.03319.43
5.4.400.0030.06319.13
5.4.390.0000.07019.04
5.4.380.0070.07318.85
5.4.370.0100.06718.88
5.4.360.0100.03319.03
5.4.350.0000.05718.88
5.4.340.0070.06319.05
5.4.320.0100.05019.16
5.4.310.0100.07019.05
5.4.300.0030.07019.12
5.4.290.0070.04719.03
5.4.280.0170.07019.02
5.4.270.0070.08019.04
5.4.260.0230.06718.87
5.4.250.0100.04019.20
5.4.240.0070.07018.89
5.4.230.0100.04019.13
5.4.220.0070.07718.94
5.4.210.0130.04319.09
5.4.200.0030.06319.16
5.4.190.0130.05719.11
5.4.180.0070.08719.04
5.4.170.0000.07319.02
5.4.160.0100.07319.19
5.4.150.0070.07719.21
5.4.140.0070.04316.55
5.4.130.0070.07016.46
5.4.120.0070.05716.49
5.4.110.0000.05016.39
5.4.100.0100.07016.56
5.4.90.0000.06716.33
5.4.80.0070.07316.36
5.4.70.0030.06716.55
5.4.60.0100.06016.39
5.4.50.0030.05316.36
5.4.40.0030.08316.38
5.4.30.0170.06316.44
5.4.20.0000.07016.30
5.4.10.0030.05016.33
5.4.00.0070.04015.78
5.3.290.0130.05314.60
5.3.280.0130.06714.71
5.3.270.0100.03714.71
5.3.260.0070.07314.53
5.3.250.0100.04014.74
5.3.240.0070.07714.54
5.3.230.0200.06014.69
5.3.220.0100.03714.62
5.3.210.0100.07714.57
5.3.200.0100.06314.62
5.3.190.0130.07014.55
5.3.180.0100.07314.68
5.3.170.0100.08014.63
5.3.160.0030.04314.63
5.3.150.0070.07314.59
5.3.140.0070.08014.52
5.3.130.0070.07014.47
5.3.120.0130.07314.57
5.3.110.0030.07714.57
5.3.100.0130.06014.11
5.3.90.0070.06314.15
5.3.80.0030.07013.95
5.3.70.0070.04314.07
5.3.60.0070.07313.91
5.3.50.0070.04014.07
5.3.40.0070.07314.04
5.3.30.0070.07013.96
5.3.20.0030.04713.61
5.3.10.0130.04713.71
5.3.00.0100.06713.57
5.2.170.0030.03712.30
5.2.160.0030.05312.30
5.2.150.0100.05712.30
5.2.140.0030.06312.30
5.2.130.0000.06312.30
5.2.120.0000.06712.30
5.2.110.0030.05312.30
5.2.100.0100.05712.30
5.2.90.0000.05012.30
5.2.80.0100.05012.30
5.2.70.0100.05012.30
5.2.60.0070.05012.30
5.2.50.0030.06312.30
5.2.40.0030.06012.30
5.2.30.0030.06012.30
5.2.20.0000.05012.30
5.2.10.0000.03312.30
5.2.00.0030.06312.30
5.1.60.0100.05312.30
5.1.50.0070.04312.30
5.1.40.0030.04712.30
5.1.30.0070.02312.30
5.1.20.0070.04312.30
5.1.10.0030.04312.30
5.1.00.0000.06012.30
5.0.50.0000.04712.30
5.0.40.0030.03712.30
5.0.30.0000.06712.30
5.0.20.0130.03312.30
5.0.10.0070.03712.30
5.0.00.0070.06012.30
4.4.90.0000.03712.30
4.4.80.0000.03712.30
4.4.70.0000.03312.30
4.4.60.0030.03712.30
4.4.50.0100.02312.30
4.4.40.0030.03012.30
4.4.30.0030.01712.30
4.4.20.0070.01712.30
4.4.10.0070.02012.30
4.4.00.0070.05012.30
4.3.110.0070.02012.30
4.3.100.0000.03012.30
4.3.90.0000.03312.30
4.3.80.0000.05312.30
4.3.70.0030.01712.30
4.3.60.0000.03712.30
4.3.50.0030.03712.30
4.3.40.0000.05312.30
4.3.30.0000.03712.30
4.3.20.0000.03712.30
4.3.10.0070.03012.30
4.3.00.0000.03712.30

preferences:
40.96 ms | 400 KiB | 5 Q