3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Url { private $user; private $pass; private $scheme; private $host; private $port; private $path; private $query = array(); private $fragment; public function __construct($url){ $parts = parse_url($url); $parts = array_merge(array("user"=>"","pass"=>"", "scheme"=>"", "host"=>"", "port"=>"", "path"=>"", "query"=>"", "fragment"=>""), $parts); $this->user = $parts["user"]; $this->pass = $parts["pass"]; $this->scheme = $parts["scheme"]; $this->host = $parts["host"]; $this->port = $parts["port"]; $this->path = $parts["path"]; parse_str($parts["query"], $this->query); $this->fragment = $parts["fragment"]; } public function __get($property){ if (!property_exists($this, $property)){ throw new ErrorException("Property $property does not exist"); } return $this->$property; } public function __set($property, $value){ if (!property_exists($this, $property)){ throw new ErrorException("Property $property does not exist"); } $this->$property = $value; } public function setQueryParam($key, $value){ $this->query[$key] = $value; } public function getQueryParam($key, $default = false){ if (array_key_exists($key, $this->query)){ return $this->query["key"]; } else { return $default; } } public function __toString(){ return ($this->scheme?$this->scheme."://":""). ($this->user && $this->pass?$this->user.":".$this->pass."@":($this->user?$this->user."@":"")). ($this->host?$this->host:""). ($this->path?$this->path:""). ($this->query?"?".http_build_query($this->query):""). ($this->fragment?"#".$this->fragment:""); } } $url = new Url("http://test.com/test-one,two three?a=b#bla"); $url->setQueryParam("a", "blah"); $url->setQueryParam("foo", "bar"); $url->scheme = "https"; $url->user = "admin"; $url->pass = "topsecret"; echo (string)$url; ?>

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.0130.00318.68
8.3.50.0230.00522.11
8.3.40.0120.00319.00
8.3.30.0110.00419.07
8.3.20.0040.00420.11
8.3.10.0080.00022.14
8.3.00.0000.00822.58
8.2.180.0130.00316.50
8.2.170.0120.00622.96
8.2.160.0130.00720.97
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0060.00326.16
8.2.120.0000.00817.75
8.2.110.0030.00619.27
8.2.100.0110.00017.84
8.2.90.0090.00017.75
8.2.80.0000.00818.73
8.2.70.0060.00317.50
8.2.60.0040.00417.63
8.2.50.0040.00417.63
8.2.40.0040.00417.75
8.2.30.0040.00418.10
8.2.20.0040.00417.79
8.2.10.0000.00819.41
8.2.00.0040.00717.81
8.1.280.0120.00925.92
8.1.270.0080.00022.13
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0040.00821.89
8.1.230.0030.00721.22
8.1.220.0040.00418.86
8.1.210.0000.00818.77
8.1.200.0000.00817.35
8.1.190.0060.00317.35
8.1.180.0030.00518.10
8.1.170.0050.00517.62
8.1.160.0040.00421.99
8.1.150.0040.00418.74
8.1.140.0000.00817.52
8.1.130.0050.00217.89
8.1.120.0000.00717.43
8.1.110.0040.00417.51
8.1.100.0000.00717.48
8.1.90.0020.00517.45
8.1.80.0050.00217.59
8.1.70.0040.00417.54
8.1.60.0000.00817.63
8.1.50.0000.00717.44
8.1.40.0050.00317.54
8.1.30.0000.00817.71
8.1.20.0000.00817.70
8.1.10.0040.00417.50
8.1.00.0040.00417.46
8.0.300.0000.00720.13
8.0.290.0000.00716.88
8.0.280.0000.00718.43
8.0.270.0040.00417.32
8.0.260.0030.00316.84
8.0.250.0000.00716.96
8.0.240.0000.00717.04
8.0.230.0040.00416.91
8.0.220.0000.00716.85
8.0.210.0000.00816.86
8.0.200.0030.00317.08
8.0.190.0000.00816.85
8.0.180.0090.00316.92
8.0.170.0040.00416.87
8.0.160.0060.00317.00
8.0.150.0070.00016.94
8.0.140.0040.00416.95
8.0.130.0000.00613.34
8.0.120.0040.00416.80
8.0.110.0080.00017.03
8.0.100.0040.00417.02
8.0.90.0050.00316.96
8.0.80.0000.01517.00
8.0.70.0000.00716.78
8.0.60.0040.00416.84
8.0.50.0030.00716.98
8.0.30.0110.01217.18
8.0.20.0090.01017.40
8.0.10.0070.00016.93
8.0.00.0130.00716.87
7.4.330.0020.00215.02
7.4.320.0030.00316.58
7.4.300.0040.00416.58
7.4.290.0070.00016.68
7.4.280.0050.00316.59
7.4.270.0030.00316.57
7.4.260.0070.00016.59
7.4.250.0040.00416.48
7.4.240.0020.00516.55
7.4.230.0000.00816.65
7.4.220.0070.01116.59
7.4.210.0070.00716.58
7.4.200.0030.00316.47
7.4.190.0040.00416.74
7.4.160.0140.00516.42
7.4.150.0060.01217.40
7.4.140.0080.01517.86
7.4.130.0080.01216.57
7.4.120.0100.00716.69
7.4.110.0070.01016.53
7.4.100.0150.00616.54
7.4.90.0090.01216.48
7.4.80.0110.00719.39
7.4.70.0130.00616.47
7.4.60.0100.01016.63
7.4.50.0000.00516.27
7.4.40.0100.00622.77
7.4.30.0030.01316.75
7.4.00.0100.00314.74
7.3.330.0000.00513.29
7.3.320.0030.00313.42
7.3.310.0030.00316.36
7.3.300.0040.00416.42
7.3.290.0080.00616.34
7.3.280.0090.00916.45
7.3.270.0120.00817.40
7.3.260.0090.01016.67
7.3.250.0110.00716.58
7.3.240.0100.01016.41
7.3.230.0000.01816.59
7.3.210.0220.00416.41
7.3.200.0060.01319.39
7.3.190.0080.01416.60
7.3.180.0090.00616.56
7.3.170.0110.01116.30
7.3.160.0090.00616.79
7.3.120.0030.01014.76
7.3.10.0060.00616.75
7.3.00.0030.00816.82
7.2.330.0090.01516.81
7.2.320.0070.01116.70
7.2.310.0100.01316.52
7.2.300.0100.00716.52
7.2.290.0090.00916.68
7.2.130.0040.00816.97
7.2.120.0040.00416.57
7.2.110.0000.01217.03
7.2.100.0030.00916.91
7.2.90.0060.00616.75
7.2.80.0000.01416.99
7.2.70.0000.01117.05
7.2.60.0030.01216.86
7.2.50.0090.00317.01
7.2.40.0070.00717.09
7.2.30.0070.00717.11
7.2.20.0060.00617.08
7.2.10.0120.00316.70
7.2.00.0050.00918.28
7.1.250.0060.00315.73
7.1.100.0060.00618.30
7.1.70.0030.00617.23
7.1.60.0100.01419.82
7.1.50.0150.00617.02
7.1.00.0070.07322.44
7.0.200.0000.00716.74
7.0.140.0070.07322.16
7.0.100.0530.05019.96
7.0.90.0330.08019.91
7.0.80.0200.07719.95
7.0.70.0200.07719.90
7.0.60.0170.07719.97
7.0.50.0100.08320.25
7.0.40.0170.04020.02
7.0.30.0130.08020.14
7.0.20.0170.08020.09
7.0.10.0100.08320.10
7.0.00.0100.04020.07
5.6.280.0030.07021.17
5.6.250.0030.09320.64
5.6.240.0130.05720.53
5.6.230.0130.06020.56
5.6.220.0100.07320.54
5.6.210.0030.05720.63
5.6.200.0100.08321.13
5.6.190.0030.07321.11
5.6.180.0070.09020.98
5.6.170.0100.08720.97
5.6.160.0100.07721.05
5.6.150.0070.08320.96
5.6.140.0030.08721.08
5.6.130.0070.08320.96
5.6.120.0030.08721.07
5.6.110.0000.07021.09
5.6.100.0070.08321.09
5.6.90.0130.07321.13
5.6.80.0100.07720.45
5.6.70.0100.07020.47
5.6.60.0070.08720.45
5.6.50.0030.07320.46
5.6.40.0100.07720.46
5.6.30.0000.05320.42
5.6.20.0070.07720.39
5.6.10.0070.04720.48
5.6.00.0070.04320.42
5.5.380.0030.09020.48
5.5.370.0100.08320.41
5.5.360.0170.07720.42
5.5.350.0100.08320.44
5.5.340.0070.08320.85
5.5.330.0030.05020.88
5.5.320.0130.07720.78
5.5.310.0070.07720.87
5.5.300.0070.04320.75
5.5.290.0070.07720.66
5.5.280.0000.04720.85
5.5.270.0100.08020.80
5.5.260.0130.07320.88
5.5.250.0100.06720.63
5.5.240.0100.08720.33
5.5.230.0000.06720.27
5.5.220.0170.07320.25
5.5.210.0030.08720.04
5.5.200.0100.04320.30
5.5.190.0130.07720.20
5.5.180.0030.08320.24
5.5.160.0030.06020.30
5.5.150.0130.03720.13
5.5.140.0030.04320.25
5.5.130.0070.05320.25
5.5.120.0070.03720.01
5.5.110.0070.04320.16
5.5.100.0000.04320.04
5.5.90.0000.04019.99
5.5.80.0000.04320.12
5.5.70.0030.07020.05
5.5.60.0100.03320.08
5.5.50.0070.05020.08
5.5.40.0070.05719.98
5.5.30.0100.07019.96
5.5.20.0000.04320.05
5.5.10.0070.04020.11
5.5.00.0000.04320.13
5.4.450.0030.08019.48
5.4.440.0070.06319.50
5.4.430.0100.06719.55
5.4.420.0130.07319.41
5.4.410.0030.08319.14
5.4.400.0000.08718.85
5.4.390.0100.07319.07
5.4.380.0030.08319.20
5.4.370.0070.06718.85
5.4.360.0100.06719.04
5.4.350.0170.07719.21
5.4.340.0030.08719.04
5.4.320.0130.07319.05
5.4.310.0100.03718.88
5.4.300.0030.04018.87
5.4.290.0100.03019.14
5.4.280.0100.03719.09
5.4.270.0030.03718.88
5.4.260.0070.04019.12
5.4.250.0100.03019.10
5.4.240.0030.03718.89
5.4.230.0000.04719.08
5.4.220.0070.04718.84
5.4.210.0070.05319.04
5.4.200.0030.07719.17
5.4.190.0130.06018.86
5.4.180.0030.04019.11
5.4.170.0070.03319.03
5.4.160.0100.04319.07
5.4.150.0030.03719.01
5.4.140.0000.05716.43
5.4.130.0030.03716.49
5.4.120.0130.06316.44
5.4.110.0030.04316.51
5.4.100.0000.05016.39
5.4.90.0070.03716.48
5.4.80.0030.03316.34
5.4.70.0000.04016.49
5.4.60.0030.03716.36
5.4.50.0070.04316.25
5.4.40.0030.03716.51
5.4.30.0000.03716.40
5.4.20.0030.03716.40
5.4.10.0070.07316.31
5.4.00.0070.05315.79
5.3.290.0100.06014.73
5.3.280.0030.03714.54
5.3.270.0100.03314.72
5.3.260.0070.03714.66
5.3.250.0070.03314.57
5.3.240.0070.04014.70
5.3.230.0070.03314.76
5.3.220.0030.03714.73
5.3.210.0030.07714.57
5.3.200.0030.04714.61
5.3.190.0000.03714.69
5.3.180.0000.04014.71
5.3.170.0030.03714.66
5.3.160.0030.03714.70
5.3.150.0100.07714.57
5.3.140.0070.03014.64
5.3.130.0030.03714.70
5.3.120.0130.05014.59
5.3.110.0030.04014.64
5.3.100.0070.05714.04
5.3.90.0070.06314.00
5.3.80.0200.06314.04
5.3.70.0070.05314.03
5.3.60.0130.07014.05
5.3.50.0100.05014.06
5.3.40.0100.07313.99
5.3.30.0070.07013.84
5.3.20.0000.07713.74
5.3.10.0100.07013.77
5.3.00.0070.07313.72
5.2.170.0130.05311.07
5.2.160.0070.06011.24
5.2.150.0070.03311.22
5.2.140.0070.06311.03
5.2.130.0070.07311.04
5.2.120.0000.06311.03
5.2.110.0000.05011.12
5.2.100.0030.06011.06
5.2.90.0070.04711.21
5.2.80.0100.06011.01
5.2.70.0100.05311.11
5.2.60.0030.05311.14
5.2.50.0030.05310.96
5.2.40.0030.06310.91
5.2.30.0100.03711.14
5.2.20.0070.05311.00
5.2.10.0030.06310.89
5.2.00.0070.06010.81
5.1.60.0000.06010.48
5.1.50.0130.04310.48
5.1.40.0100.05310.48
5.1.30.0070.03310.48
5.1.20.0130.04310.48
5.1.10.0030.05010.48
5.1.00.0070.03310.48
5.0.50.0030.02310.48
5.0.40.0000.02010.48
5.0.30.0000.03310.48
5.0.20.0030.04010.48
5.0.10.0000.03710.48
5.0.00.0030.03010.48
4.4.90.0000.01710.48
4.4.80.0100.03010.48
4.4.70.0030.03710.48
4.4.60.0000.04010.48
4.4.50.0000.03710.48
4.4.40.0000.05710.48
4.4.30.0030.03010.48
4.4.20.0030.04010.48
4.4.10.0000.03010.48
4.4.00.0000.05710.48
4.3.110.0000.03310.48
4.3.100.0030.01310.48
4.3.90.0000.02310.48
4.3.80.0000.02710.48
4.3.70.0030.03310.48
4.3.60.0030.01310.48
4.3.50.0000.03710.48
4.3.40.0000.04310.48
4.3.30.0000.03710.48
4.3.20.0070.01710.48
4.3.10.0070.03310.48
4.3.00.0000.03710.48

preferences:
43.94 ms | 401 KiB | 5 Q