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"; 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.0110.00718.43
8.3.50.0120.00918.04
8.3.40.0160.00418.79
8.3.30.0000.01419.07
8.3.20.0080.00020.16
8.3.10.0070.00022.04
8.3.00.0050.00322.56
8.2.180.0170.00316.60
8.2.170.0040.01122.96
8.2.160.0110.00320.96
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0000.00826.16
8.2.120.0080.00019.36
8.2.110.0030.00622.11
8.2.100.0040.00717.91
8.2.90.0080.00019.21
8.2.80.0030.00617.97
8.2.70.0050.00317.63
8.2.60.0040.00418.05
8.2.50.0030.00618.07
8.2.40.0080.00018.28
8.2.30.0000.00718.23
8.2.20.0040.00417.86
8.2.10.0080.00019.53
8.2.00.0040.00417.73
8.1.270.0050.00322.26
8.1.260.0000.00826.35
8.1.250.0190.00028.09
8.1.240.0130.00022.18
8.1.230.0040.00720.85
8.1.220.0050.00317.91
8.1.210.0060.00318.77
8.1.200.0030.00617.48
8.1.190.0040.00417.77
8.1.180.0030.00618.10
8.1.170.0000.00818.67
8.1.160.0030.00622.13
8.1.150.0090.00018.61
8.1.140.0040.00417.46
8.1.130.0040.00417.56
8.1.120.0000.00717.52
8.1.110.0040.00417.55
8.1.100.0040.00417.52
8.1.90.0000.00717.33
8.1.80.0000.00817.46
8.1.70.0000.00717.49
8.1.60.0060.00317.54
8.1.50.0000.00717.48
8.1.40.0040.00417.45
8.1.30.0080.00017.61
8.1.20.0040.00417.64
8.1.10.0040.00417.64
8.1.00.0050.00317.53
8.0.300.0000.00718.77
8.0.290.0040.00417.28
8.0.280.0050.00318.39
8.0.270.0000.00716.80
8.0.260.0070.00016.87
8.0.250.0000.00716.94
8.0.240.0040.00416.98
8.0.230.0000.00716.98
8.0.220.0000.00716.96
8.0.210.0030.00316.93
8.0.200.0060.00317.02
8.0.190.0020.00516.92
8.0.180.0040.00416.86
8.0.170.0090.00016.94
8.0.160.0000.00716.92
8.0.150.0080.00016.84
8.0.140.0030.00416.85
8.0.130.0060.00013.42
8.0.120.0030.00516.96
8.0.110.0040.00416.86
8.0.100.0050.00217.07
8.0.90.0040.00417.00
8.0.80.0090.01216.98
8.0.70.0070.00016.95
8.0.60.0040.00416.94
8.0.50.0020.00516.90
8.0.30.0140.00517.16
8.0.20.0110.01217.40
8.0.10.0040.00417.14
8.0.00.0080.00916.89
7.4.330.0030.00315.00
7.4.320.0030.00316.55
7.4.300.0000.00716.56
7.4.290.0000.00716.57
7.4.280.0070.00016.60
7.4.270.0000.00916.56
7.4.260.0070.00416.62
7.4.250.0040.00416.63
7.4.240.0010.00616.66
7.4.230.0030.00316.64
7.4.220.0110.00716.57
7.4.210.0090.00616.55
7.4.200.0040.00416.43
7.4.190.0040.00416.60
7.4.160.0030.01216.34
7.4.150.0070.01117.40
7.4.140.0160.00617.86
7.4.130.0090.01116.61
7.4.120.0080.01016.55
7.4.110.0130.00316.68
7.4.100.0120.00616.52
7.4.90.0060.01116.58
7.4.80.0030.01419.39
7.4.70.0140.00316.71
7.4.60.0060.01116.56
7.4.50.0060.00316.66
7.4.40.0090.00922.77
7.4.30.0110.00616.59
7.4.00.0090.00614.92
7.3.330.0000.00513.21
7.3.320.0000.00613.42
7.3.310.0000.00716.48
7.3.300.0000.00716.42
7.3.290.0060.01216.39
7.3.280.0060.00916.41
7.3.270.0070.01017.40
7.3.260.0120.00616.58
7.3.250.0120.00816.48
7.3.240.0100.01016.70
7.3.230.0130.00316.62
7.3.210.0190.00316.39
7.3.200.0110.00619.39
7.3.190.0080.01616.35
7.3.180.0030.01316.54
7.3.170.0070.01016.72
7.3.160.0150.00616.37
7.3.120.0070.01315.00
7.3.110.0100.01014.99
7.3.100.0060.00914.85
7.3.90.0030.01414.79
7.3.80.0110.00614.83
7.3.70.0160.00014.89
7.3.60.0060.01314.76
7.3.50.0110.00314.87
7.3.40.0150.00014.56
7.3.30.0040.01214.96
7.3.20.0040.01416.42
7.3.10.0070.00816.51
7.3.00.0070.00616.69
7.2.330.0040.01616.82
7.2.320.0100.01316.82
7.2.310.0100.01316.72
7.2.300.0060.01016.43
7.2.290.0030.01316.87
7.2.240.0120.00615.06
7.2.230.0060.01015.05
7.2.220.0060.00915.25
7.2.210.0090.00615.21
7.2.200.0070.00714.94
7.2.190.0070.01115.09
7.2.180.0180.00014.99
7.2.170.0040.01115.09
7.2.160.0070.01115.03
7.2.150.0100.01016.76
7.2.140.0060.01216.95
7.2.130.0070.00917.01
7.2.120.0090.00516.98
7.2.110.0030.01216.64
7.2.100.0080.00716.96
7.2.90.0040.01116.91
7.2.80.0030.01216.89
7.2.70.0030.00917.06
7.2.60.0050.00816.94
7.2.50.0060.01016.89
7.2.40.0070.00716.68
7.2.30.0080.00716.93
7.2.20.0040.00917.00
7.2.10.0060.00816.75
7.2.00.0040.00916.95
7.1.330.0150.00315.64
7.1.320.0030.01315.40
7.1.310.0040.01015.75
7.1.300.0110.00315.83
7.1.290.0060.00615.64
7.1.280.0070.01115.70
7.1.270.0070.01015.54
7.1.260.0080.00315.57
7.1.250.0060.00615.75
7.1.200.0060.00615.93
7.1.70.0040.00416.77
7.1.60.0070.01719.82
7.1.50.0120.00616.99
7.1.00.0000.07722.51
7.0.200.0070.00016.81
7.0.140.0070.06321.93
7.0.60.0030.09019.83
7.0.50.0030.04317.98
7.0.40.0070.04320.18
7.0.30.0270.05020.24
7.0.20.0330.04720.09
7.0.10.0200.05720.07
7.0.00.0130.08320.27
5.6.280.0100.06721.01
5.6.210.0130.08020.63
5.6.200.0100.08318.19
5.6.190.0100.03720.43
5.6.180.3430.04720.47
5.6.170.0270.05320.61
5.6.160.0070.08320.55
5.6.150.0130.04018.24
5.6.140.0030.08318.16
5.6.130.0070.04318.21
5.6.120.0100.03721.16
5.6.110.0170.07721.13
5.6.100.0100.08021.11
5.6.90.0070.09021.10
5.6.80.0200.07020.38
5.6.70.0330.07320.55
5.5.350.0000.04720.43
5.5.340.0100.07718.05
5.5.330.0070.06320.41
5.5.320.0230.07720.31
5.5.310.0270.07720.26
5.5.300.0070.08318.08
5.5.290.0170.07717.95
5.5.280.0130.05020.66
5.5.270.0100.07720.69
5.5.260.0030.04720.82
5.5.250.0130.03720.73
5.5.240.0030.07720.27
5.4.450.0500.03719.49
5.4.440.0370.05719.46
5.4.430.0730.00019.43
5.4.420.0730.00019.20
5.4.410.0070.05718.81
5.4.400.0130.04718.77
5.4.390.0100.05018.83
5.4.380.0230.05718.76
5.4.370.0070.06018.80
5.4.360.0200.04318.80
5.4.350.0170.05318.57
5.4.340.0100.05718.55
5.4.320.0070.04112.52
5.4.310.0070.03712.51
5.4.300.0080.03412.52
5.4.290.0080.04112.52
5.4.280.0070.03512.42
5.4.270.0050.03812.41
5.4.260.0060.03712.41
5.4.250.0050.03812.42
5.4.240.0070.04212.41
5.4.230.0090.03512.40
5.4.220.0080.04012.41
5.4.210.0050.04112.41
5.4.200.0080.03612.41
5.4.190.0220.04112.40
5.4.180.0230.04112.39
5.4.170.0140.04812.41
5.4.160.0170.04612.41
5.4.150.0170.04412.40
5.4.140.0180.04612.09
5.4.130.0140.04912.07
5.4.120.0190.04212.02
5.4.110.0190.04212.02
5.4.100.0350.08912.03
5.4.90.0220.03912.02
5.4.80.0130.04612.02
5.4.70.0320.09112.02
5.4.60.0180.04212.02
5.4.50.0230.04112.02
5.4.40.0180.04212.00
5.4.30.0370.08612.01
5.4.20.0160.04412.01
5.4.10.0220.03812.01
5.4.00.0120.04611.49
5.3.290.0060.04112.80
5.3.280.0090.03812.71
5.3.270.0130.04912.72
5.3.260.0180.04512.72
5.3.250.0150.04812.72
5.3.240.0190.04312.72
5.3.230.0180.04512.70
5.3.220.0310.09112.68
5.3.210.0110.05012.68
5.3.200.0160.04412.68
5.3.190.0180.04312.68
5.3.180.0150.04512.68
5.3.170.0250.06412.67
5.3.160.0190.04212.67
5.3.150.0160.04512.67
5.3.140.0160.04512.66
5.3.130.0150.04512.66
5.3.120.0150.04812.66
5.3.110.0190.07112.66
5.3.100.0220.04512.12
5.3.90.0220.03912.09
5.3.80.0210.04512.09
5.3.70.0280.07212.09
5.3.60.0390.08812.07
5.3.50.0120.04812.02
5.3.40.0160.04612.02
5.3.30.0200.04111.99
5.3.20.0180.04311.76
5.3.10.0160.04011.73
5.3.00.0180.04011.71
5.2.170.0170.0339.21
5.2.160.0200.0619.21
5.2.150.0160.0329.21
5.2.140.0100.0379.21
5.2.130.0180.0339.17
5.2.120.0110.0409.17
5.2.110.0120.0399.18
5.2.100.0150.0369.18
5.2.90.0370.0749.18
5.2.80.0140.0369.17
5.2.70.0140.0389.17
5.2.60.0150.0339.13
5.2.50.0140.0349.08
5.2.40.0120.0369.06
5.2.30.0150.0319.04
5.2.20.0130.0339.04
5.2.10.0140.0338.94
5.2.00.0160.0298.79
5.1.60.0140.0268.08
5.1.50.0090.0318.07
5.1.40.0090.0308.07
5.1.30.0110.0318.41
5.1.20.0260.0488.44
5.1.10.0120.0308.15
5.1.00.0120.0308.16
5.0.50.0100.0246.63
5.0.40.0110.0226.49
5.0.30.0100.0346.31
5.0.20.0100.0226.28
5.0.10.0240.0406.25
5.0.00.0070.0396.25
4.4.90.0080.0184.78
4.4.80.0260.0314.76
4.4.70.0030.0244.76
4.4.60.0100.0164.76
4.4.50.0090.0184.77
4.4.40.0060.0314.71
4.4.30.0120.0144.76
4.4.20.0090.0174.84
4.4.10.0080.0214.85
4.4.00.0090.0314.76
4.3.110.0060.0204.67
4.3.100.0060.0204.66
4.3.90.0080.0214.64
4.3.80.0030.0344.58
4.3.70.0070.0184.63
4.3.60.0210.0344.63
4.3.50.0110.0204.63
4.3.40.0060.0314.54
4.3.30.0060.0183.30
4.3.20.0050.0203.29
4.3.10.0060.0203.24
4.3.00.0070.01015.59

preferences:
40.5 ms | 400 KiB | 5 Q