3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class AbstractLocation implements HeaderInterface { /** * URI for this header * * @var UriInterface */ protected $uri = null; /** * Create location-based header from string * * @param string $headerLine * @return AbstractLocation * @throws Exception\InvalidArgumentException */ public static function fromString($headerLine) { $locationHeader = new static(); // ZF-5520 - IIS bug, no space after colon list($name, $uri) = GenericHeader::splitHeaderLine($headerLine); // check to ensure proper header type for this factory if (strtolower($name) !== strtolower($locationHeader->getFieldName())) { throw new Exception\InvalidArgumentException( 'Invalid header line for "' . $locationHeader->getFieldName() . '" header string' ); } HeaderValue::assertValid($uri); $locationHeader->setUri(trim($uri)); return $locationHeader; } /** * Set the URI/URL for this header, this can be a string or an instance of Zend\Uri\Http * * @param string|UriInterface $uri * @return AbstractLocation * @throws Exception\InvalidArgumentException */ public function setUri($uri) { if (is_string($uri)) { try { $uri = UriFactory::factory($uri); } catch (UriException\InvalidUriPartException $e) { throw new Exception\InvalidArgumentException( sprintf('Invalid URI passed as string (%s)', (string) $uri), $e->getCode(), $e ); } } elseif (!($uri instanceof UriInterface)) { throw new Exception\InvalidArgumentException('URI must be an instance of Zend\Uri\Http or a string'); } $this->uri = $uri; return $this; } /** * Return the URI for this header * * @return string */ public function getUri() { if ($this->uri instanceof UriInterface) { return $this->uri->toString(); } return $this->uri; } /** * Return the URI for this header as an instance of Zend\Uri\Http * * @return UriInterface */ public function uri() { if ($this->uri === null || is_string($this->uri)) { $this->uri = UriFactory::factory($this->uri); } return $this->uri; } /** * Get header value as URI string * * @return string */ public function getFieldValue() { return $this->getUri(); } /** * Output header line * * @return string */ public function toString() { return $this->getFieldName() . ': ' . $this->getUri(); } /** * Allow casting to string * * @return string */ public function __toString() { return $this->toString(); } }

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.0120.00917.00
8.3.50.0140.00622.00
8.3.40.0090.00618.88
8.3.30.0070.00718.84
8.3.20.0000.00820.21
8.3.10.0050.00323.59
8.3.00.0040.00420.94
8.2.180.0120.00316.63
8.2.170.0110.00422.96
8.2.160.0200.00020.65
8.2.150.0050.00324.18
8.2.140.0120.00624.66
8.2.130.0060.00319.56
8.2.120.0040.00426.35
8.2.110.0030.00622.30
8.2.100.0110.00017.79
8.2.90.0080.00019.30
8.2.80.0040.00418.05
8.2.70.0000.00917.63
8.2.60.0050.00317.80
8.2.50.0080.00018.07
8.2.40.0040.00422.32
8.2.30.0040.00420.85
8.2.20.0000.00717.82
8.2.10.0040.00418.14
8.2.00.0000.00718.07
8.1.280.0120.00325.92
8.1.270.0140.00420.37
8.1.260.0050.00328.09
8.1.250.0080.00028.09
8.1.240.0060.00322.21
8.1.230.0080.00419.27
8.1.220.0050.00317.74
8.1.210.0060.00318.77
8.1.200.0000.00817.48
8.1.190.0040.00417.48
8.1.180.0080.00018.10
8.1.170.0060.00518.36
8.1.160.0040.00420.79
8.1.150.0030.00518.83
8.1.140.0040.00419.52
8.1.130.0030.00317.72
8.1.120.0000.00817.38
8.1.110.0080.00017.41
8.1.100.0040.00417.49
8.1.90.0050.00217.53
8.1.80.0000.00917.37
8.1.70.0000.00717.32
8.1.60.0030.00617.47
8.1.50.0040.00417.58
8.1.40.0030.00517.54
8.1.30.0080.00017.70
8.1.20.0030.00517.52
8.1.10.0040.00717.47
8.1.00.0000.00717.49
8.0.300.0050.00218.77
8.0.290.0040.00416.75
8.0.280.0030.00318.59
8.0.270.0000.00717.21
8.0.260.0030.00317.26
8.0.250.0050.00217.00
8.0.240.0030.00316.98
8.0.230.0000.00817.08
8.0.220.0000.00717.04
8.0.210.0040.00417.04
8.0.200.0080.00017.12
8.0.190.0080.00017.14
8.0.180.0040.00417.05
8.0.170.0040.00417.00
8.0.160.0040.00417.15
8.0.150.0030.00517.05
8.0.140.0030.00516.91
8.0.130.0000.00713.42
8.0.120.0030.00516.96
8.0.110.0000.00717.00
8.0.100.0040.00417.15
8.0.90.0030.00516.84
8.0.80.0060.01117.11
8.0.70.0080.00017.04
8.0.60.0000.00716.89
8.0.50.0040.00416.84
8.0.30.0080.01017.15
8.0.20.0100.01117.40
8.0.10.0040.00417.13
8.0.00.0120.00816.85
7.4.330.0000.00516.82
7.4.320.0040.00416.60
7.4.300.0030.00316.68
7.4.290.0070.00316.41
7.4.280.0040.00416.43
7.4.270.0080.00016.61
7.4.260.0080.00016.64
7.4.250.0040.00416.50
7.4.240.0050.00216.60
7.4.230.0000.00716.69
7.4.220.0080.01316.54
7.4.210.0060.01016.39
7.4.200.0030.00516.41
7.4.160.0090.00616.38
7.4.150.0070.01117.40
7.4.140.0110.01117.86
7.4.130.0060.01016.48
7.4.120.0160.00616.56
7.4.110.0100.00716.63
7.4.100.0090.01216.56
7.4.90.0040.01416.62
7.4.80.0070.01119.39
7.4.70.0110.00716.58
7.4.60.0150.00316.79
7.4.50.0120.00816.65
7.4.40.0140.00316.57
7.4.30.0110.00716.60
7.4.00.0070.01115.17
7.3.330.0030.00313.27
7.3.320.0030.00313.28
7.3.310.0070.00016.17
7.3.300.0000.00716.25
7.3.290.0020.01416.26
7.3.280.0120.00616.30
7.3.270.0180.00017.40
7.3.260.0150.00316.36
7.3.250.0130.00816.36
7.3.240.0110.00716.46
7.3.230.0040.01516.39
7.3.210.0060.01216.43
7.3.200.0030.01316.38
7.3.190.0060.01816.40
7.3.180.0080.00716.36
7.3.170.0060.01016.42
7.3.160.0030.01716.57
7.2.330.0070.01016.37
7.2.320.0190.00316.60
7.2.310.0100.00716.51
7.2.300.0120.00916.61
7.2.290.0070.01016.36
7.2.60.0090.00416.80
7.2.00.0030.01019.46
7.1.200.0080.00415.48
7.1.100.0080.00318.00
7.1.70.0000.01017.03
7.1.60.0100.01319.52
7.1.50.0070.01316.91
7.1.00.0030.07722.45
7.0.200.0050.00516.57
7.0.60.0030.07719.95
7.0.50.0030.06017.90
7.0.40.0000.05319.96
7.0.30.0470.05720.10
7.0.20.0270.06720.10
7.0.10.0130.04720.30
7.0.00.0030.08720.06
5.6.280.0030.03021.15
5.6.210.0100.05020.49
5.6.200.0100.07718.16
5.6.190.0170.08320.63
5.6.180.0270.07720.46
5.6.170.0300.08020.44
5.6.160.0000.04320.39
5.6.150.0100.04018.13
5.6.140.0030.07018.17
5.6.130.0100.07718.18
5.6.120.0070.05321.05
5.6.110.0100.07321.13
5.6.100.0100.07720.99
5.6.90.0070.06320.90
5.6.80.0070.08720.55
5.5.350.0030.07720.34
5.5.340.0000.04017.94
5.5.330.0030.04020.57
5.5.320.0170.04720.30
5.5.310.0330.08020.35
5.5.300.0100.04017.98
5.5.290.0070.04318.01
5.5.280.0070.06720.82
5.5.270.0100.08320.90
5.5.260.0200.07320.82
5.5.250.0070.08020.78
5.5.240.0230.07320.37

preferences:
53.94 ms | 401 KiB | 5 Q