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 = []; 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"; ?>

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.0100.00717.00
8.3.50.0140.00721.90
8.3.40.0110.00718.84
8.3.30.0070.00719.09
8.3.20.0050.00220.29
8.3.10.0080.00023.65
8.3.00.0000.00919.38
8.2.180.0110.00718.54
8.2.170.0100.00522.96
8.2.160.0130.00720.35
8.2.150.0080.00024.18
8.2.140.0130.00024.66
8.2.130.0080.00026.16
8.2.120.0030.00522.22
8.2.110.0030.00622.24
8.2.100.0120.00017.72
8.2.90.0040.00419.25
8.2.80.0000.00817.97
8.2.70.0030.00717.63
8.2.60.0080.00317.78
8.2.50.0030.00619.23
8.2.40.0080.00019.63
8.2.30.0020.00518.07
8.2.20.0040.00417.73
8.2.10.0000.00818.17
8.2.00.0080.00017.80
8.1.280.0060.00925.92
8.1.270.0060.00923.79
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0060.00321.95
8.1.230.0040.00819.04
8.1.220.0030.00517.74
8.1.210.0030.00518.77
8.1.200.0030.00717.48
8.1.190.0040.00417.48
8.1.180.0000.01018.10
8.1.170.0030.00518.68
8.1.160.0040.00422.01
8.1.150.0070.00018.73
8.1.140.0040.00417.51
8.1.130.0030.00317.88
8.1.120.0050.00217.50
8.1.110.0070.00017.54
8.1.100.0040.00417.46
8.1.90.0000.00717.54
8.1.80.0000.00817.53
8.1.70.0070.00017.50
8.1.60.0000.00917.71
8.1.50.0080.00017.47
8.1.40.0060.00317.55
8.1.30.0030.00517.64
8.1.20.0000.00717.54
8.1.10.0080.00017.53
8.1.00.0090.00017.54
8.0.300.0080.00018.77
8.0.290.0040.00417.30
8.0.280.0030.00318.50
8.0.270.0030.00317.39
8.0.260.0040.00417.31
8.0.250.0030.00317.06
8.0.240.0070.00016.96
8.0.230.0080.00016.91
8.0.220.0000.00716.84
8.0.210.0030.00316.89
8.0.200.0050.00317.04
8.0.190.0060.00316.95
8.0.180.0040.00417.02
8.0.170.0000.00716.95
8.0.160.0030.00517.01
8.0.150.0000.00816.85
8.0.140.0070.00016.93
8.0.130.0060.00013.34
8.0.120.0060.00316.84
8.0.110.0000.00716.94
8.0.100.0000.00716.77
8.0.90.0040.00416.85
8.0.80.0120.00316.94
8.0.70.0030.00616.94
8.0.60.0040.00416.97
8.0.50.0000.00716.91
8.0.30.0030.01617.11
8.0.20.0110.01017.40
8.0.10.0040.00417.12
8.0.00.0090.00916.85
7.4.330.0000.00615.15
7.4.320.0030.00316.47
7.4.300.0000.00616.49
7.4.290.0000.00716.66
7.4.280.0000.00716.65
7.4.270.0040.00416.67
7.4.260.0030.00316.56
7.4.250.0000.00816.51
7.4.240.0020.00516.54
7.4.230.0030.00316.47
7.4.220.0040.01516.60
7.4.210.0010.01316.70
7.4.200.0030.00316.31
7.4.190.0060.00316.73
7.4.160.0100.01016.55
7.4.150.0100.00717.40
7.4.140.0070.01317.86
7.4.130.0120.00716.56
7.4.120.0070.01516.48
7.4.110.0000.01816.50
7.4.100.0100.00716.65
7.4.90.0060.01516.53
7.4.80.0100.00719.39
7.4.70.0060.01116.48
7.4.60.0070.01116.37
7.4.50.0060.00316.57
7.4.40.0150.00716.67
7.4.30.0070.01016.51
7.4.00.0100.00515.01
7.3.330.0070.00013.42
7.3.320.0030.00313.54
7.3.310.0030.00316.43
7.3.300.0000.00716.39
7.3.290.0030.01016.48
7.3.280.0070.00816.38
7.3.270.0110.00617.40
7.3.260.0100.00716.48
7.3.250.0170.00316.43
7.3.240.0110.00716.63
7.3.230.0150.00416.42
7.3.210.0100.01316.68
7.3.200.0100.01319.39
7.3.190.0100.00716.66
7.3.180.0100.00616.63
7.3.170.0160.00616.42
7.3.160.0110.00416.38
7.3.120.0070.01114.87
7.3.110.0030.01214.90
7.3.100.0070.01314.88
7.3.90.0070.01014.81
7.3.80.0030.00714.96
7.3.70.0000.00814.96
7.3.60.0030.01014.92
7.3.50.0030.00714.94
7.3.40.0070.00314.68
7.3.30.0040.01114.59
7.3.20.0060.00616.71
7.3.10.0060.00416.66
7.3.00.0030.00916.48
7.2.330.0070.01116.93
7.2.320.0070.01416.78
7.2.310.0210.00316.75
7.2.300.0080.00816.46
7.2.290.0030.01516.74
7.2.250.0070.01315.30
7.2.240.0040.01515.05
7.2.230.0120.00314.86
7.2.220.0060.00915.13
7.2.210.0090.00314.88
7.2.200.0030.00915.09
7.2.190.0030.01114.86
7.2.180.0050.00515.17
7.2.170.0080.00515.05
7.2.160.0030.00614.85
7.2.150.0060.00916.92
7.2.140.0040.01116.87
7.2.130.0030.01116.95
7.2.120.0090.00516.89
7.2.110.0060.00716.94
7.2.100.0060.00516.94
7.2.90.0050.00816.86
7.2.80.0040.00616.90
7.2.70.0080.00816.94
7.2.60.0080.00616.91
7.2.50.0060.00916.88
7.2.40.0050.00916.94
7.2.30.0050.00917.04
7.2.20.0100.00716.80
7.2.10.0060.00916.79
7.2.00.0070.00617.74
7.1.330.0130.00315.63
7.1.320.0090.00615.42
7.1.310.0070.00415.78
7.1.300.0070.00715.79
7.1.290.0100.00715.89
7.1.280.0030.00915.84
7.1.270.0060.00315.88
7.1.260.0110.00315.77
7.1.250.0030.01315.66
7.1.240.0070.00715.82
7.1.230.0000.01015.95
7.1.220.0060.00615.76
7.1.210.0050.00515.83
7.1.200.0080.00215.75
7.1.190.0060.00915.64
7.1.180.0070.00715.93
7.1.170.0000.01315.89
7.1.160.0060.00316.00
7.1.150.0060.00615.84
7.1.140.0070.00715.58
7.1.130.0060.00315.87
7.1.120.0070.00315.91
7.1.110.0040.01215.61
7.1.100.0040.00717.01
7.1.90.0040.00815.92
7.1.80.0090.00616.02
7.1.70.0080.00516.46
7.1.60.0030.01017.63
7.1.50.0030.01125.37
7.1.40.0000.01615.91
7.1.30.0060.00615.91
7.1.20.0030.01115.70
7.1.10.0030.00915.96
7.1.00.0070.04019.15
7.0.330.0070.00715.30
7.0.320.0000.01215.35
7.0.310.0000.01415.62
7.0.300.0000.01015.23
7.0.290.0040.01114.95
7.0.280.0030.00915.09
7.0.270.0100.00015.36
7.0.260.0000.01315.38
7.0.250.0030.00915.31
7.0.240.0120.00015.28
7.0.230.0120.00015.29
7.0.220.0120.00315.51
7.0.210.0080.00815.28
7.0.200.0050.00516.17
7.0.190.0080.00515.11
7.0.180.0040.01115.23
7.0.170.0090.00615.40
7.0.160.0070.00715.37
7.0.150.0000.01115.55
7.0.140.0040.03818.64
7.0.130.0030.00915.60
7.0.120.0030.01015.57
7.0.110.0060.00615.54
7.0.100.0100.00315.47
7.0.90.0070.00715.12
7.0.80.0360.04317.67
7.0.70.0330.03817.64
7.0.60.0350.04517.71
7.0.50.0340.04417.93
7.0.40.0050.05016.86
7.0.30.0090.04616.84
7.0.20.0080.03716.79
7.0.10.0110.04316.87
7.0.00.0100.04416.86
5.6.400.0000.01114.70
5.6.390.0070.01014.69
5.6.380.0030.01314.15
5.6.370.0000.01114.15
5.6.360.0100.00614.63
5.6.350.0030.00714.56
5.6.340.0030.01414.67
5.6.330.0060.00314.20
5.6.320.0060.00914.18
5.6.310.0070.00314.22
5.6.300.0040.00814.51
5.6.290.0070.01014.58
5.6.280.0070.03817.51
5.6.270.0030.01214.58
5.6.260.0030.01014.45
5.6.250.0000.01314.45
5.6.240.0090.00614.57
5.6.230.0100.04117.53
5.6.220.0080.04417.60
5.6.210.0080.03317.52
5.6.200.0140.04117.82
5.6.190.0100.04317.80
5.6.180.0120.04217.84
5.6.170.0080.04817.74
5.6.160.0050.02817.81
5.6.150.0110.02217.82
5.6.140.0070.03717.76
5.6.130.0050.03217.66
5.6.120.0100.04317.67
5.6.110.0060.04617.72
5.6.100.0060.04617.76
5.6.90.0080.02517.74
5.6.80.0050.02517.36
5.6.70.0070.03817.38
5.6.60.0110.02117.54
5.6.50.0090.02717.37
5.6.40.0030.04917.43
5.6.30.0110.03817.48
5.6.20.0030.04517.29
5.6.10.0140.03617.29
5.6.00.0130.03517.39
5.5.380.0090.00613.89
5.5.370.0070.04017.32
5.5.360.0050.03017.39
5.5.350.0080.04517.38
5.5.340.0070.02817.54
5.5.330.0070.03517.52
5.5.320.0100.04217.48
5.5.310.0050.04817.64
5.5.300.0050.03217.63
5.5.290.0020.04817.44
5.5.280.0080.04717.71
5.5.270.0050.04217.54
5.5.260.0070.04617.48
5.5.250.0050.04817.52
5.5.240.0100.03817.19
5.5.230.0070.04417.20
5.5.220.0040.04317.21
5.5.210.0060.04217.15
5.5.200.0070.04017.21
5.5.190.0070.04217.16
5.5.180.0050.03517.18
5.5.170.0030.01014.39
5.5.160.0080.03917.27
5.5.150.0100.03517.28
5.5.140.0130.03817.10
5.5.130.0040.04217.13
5.5.120.0080.03817.23
5.5.110.0120.03717.15
5.5.100.0020.03217.04
5.5.90.0050.03617.03
5.5.80.0030.04517.32
5.5.70.0070.04516.98
5.5.60.0030.04517.25
5.5.50.0070.03917.08
5.5.40.0030.04517.07
5.5.30.0060.04317.16
5.5.20.0050.04716.96
5.5.10.0160.02117.13
5.5.00.0050.04216.96
5.4.450.0050.02316.47
5.4.440.0080.03816.61
5.4.430.0020.02716.50
5.4.420.0030.02916.51
5.4.410.0100.03816.49
5.4.400.0090.02116.30
5.4.390.0020.04016.41
5.4.380.0090.03516.35
5.4.370.0100.03416.34
5.4.360.0050.04116.42
5.4.350.0050.03916.37
5.4.340.0050.04116.44
5.4.330.0040.00813.66
5.4.320.0020.03816.41
5.4.310.0070.04316.41
5.4.300.0090.04516.25
5.4.290.0090.02716.41
5.4.280.0070.02016.40
5.4.270.0030.02816.26
5.4.260.0030.03716.39
5.4.250.0090.02816.25
5.4.240.0070.04016.40
5.4.230.0080.03816.30
5.4.220.0120.03416.39
5.4.210.0030.04316.35
5.4.200.0010.04316.34
5.4.190.0070.03616.35
5.4.180.0050.03716.44
5.4.170.0080.03816.38
5.4.160.0090.03816.24
5.4.150.0070.03116.36
5.4.140.0060.03815.05
5.4.130.0050.03015.04
5.4.120.0050.03615.00
5.4.110.0050.03814.97
5.4.100.0060.02315.06
5.4.90.0020.02815.02
5.4.80.0040.02614.96
5.4.70.0030.04315.07
5.4.60.0100.03415.05
5.4.50.0110.03315.03
5.4.40.0050.02215.02
5.4.30.0020.02314.98
5.4.20.0030.04315.06
5.4.10.0070.02715.03
5.4.00.0080.03714.76
5.3.290.0070.04014.14
5.3.280.0040.04214.11
5.3.270.0080.02114.15
5.3.260.0070.02314.09
5.3.250.0030.04114.16
5.3.240.0080.03514.18
5.3.230.0050.04414.19
5.3.220.0020.04214.09
5.3.210.0070.03814.16
5.3.200.0030.02414.13
5.3.190.0050.03814.18
5.3.180.0080.03514.11
5.3.170.0070.02414.08
5.3.160.0070.03214.16
5.3.150.0050.03814.15
5.3.140.0000.03414.15
5.3.130.0050.03814.08
5.3.120.0020.04314.06
5.3.110.0050.04214.09
5.3.100.0080.02213.81
5.3.90.0020.03213.91
5.3.80.0030.02013.88
5.3.70.0050.03813.79
5.3.60.0080.03513.78
5.3.50.0020.02713.83
5.3.40.0080.04013.81
5.3.30.0020.04113.80
5.3.20.0100.02513.70
5.3.10.0050.03513.64
5.3.00.0020.02813.64
5.2.170.0000.03713.56
5.2.160.0000.06713.56
5.2.150.0070.05313.56
5.2.140.0000.04013.56
5.2.130.0030.06713.56
5.2.120.0000.04713.56
5.2.110.0030.06313.56
5.2.100.0000.06313.56
5.2.90.0000.06313.56
5.2.80.0100.05713.56
5.2.70.0030.05013.56
5.2.60.0030.05013.56
5.2.50.0000.05313.56
5.2.40.0000.03313.56
5.2.30.0030.06013.56
5.2.20.0030.04013.56
5.2.10.0030.05013.56
5.2.00.0030.03313.56
5.1.60.0070.05013.56
5.1.50.0170.04313.56
5.1.40.0030.04013.56
5.1.30.0000.03713.56
5.1.20.0030.03313.56
5.1.10.0100.03713.56
5.1.00.0000.03313.56
5.0.50.0030.03013.56
5.0.40.0000.04713.56
5.0.30.0070.06013.56
5.0.20.0000.04313.56
5.0.10.0070.03013.56
5.0.00.0070.05013.56
4.4.90.0000.04013.56
4.4.80.0000.04013.56
4.4.70.0070.03013.56
4.4.60.0070.03313.56
4.4.50.0070.03013.56
4.4.40.0070.05013.56
4.4.30.0070.01313.56
4.4.20.0000.03313.56
4.4.10.0000.03313.56
4.4.00.0070.05013.56
4.3.110.0000.02313.56
4.3.100.0000.02313.56
4.3.90.0030.03013.56
4.3.80.0000.04013.56
4.3.70.0000.03313.56
4.3.60.0000.03313.56
4.3.50.0000.03713.56
4.3.40.0070.04713.56
4.3.30.0000.02713.56
4.3.20.0030.02313.56
4.3.10.0000.03713.56
4.3.00.0000.03713.56

preferences:
44.04 ms | 401 KiB | 5 Q