3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Section 4.3.5. of the CSS syntax 3 specification * * Consumes a string token as defined per section 4.3.5 of the CSS specification * @see https://www.w3.org/TR/css-syntax-3/#consume-string-token * * @param string|null $endingCodePoint * @return TString|BadString */ function consumeString(?string $endingCodePoint = null): Token { $endingCodePoint ??= $this->inputStream->next(); $string = ""; again: $codePoint = $this->inputStream->peek(); if ($codePoint === $endingCodePoint) { // Consume ending code point $this->inputStream->next(); return new TString($string); } if ($this->inputStream->isEndOfStream()) { // TODO Parse error return new TString($string); } if ($codePoint === Definitions::NEWLINE) { // TODO Parse error return new BadString($string); } if ($codePoint !== self::REVERSE_SOLIDUS) { $string .= $this->inputStream->next(); goto again; } switch ($this->inputStream->peek(1)) { case Definitions::NEWLINE: // Consume the NEW LINE $this->inputStream->next(); case '': // Consume the REVERSE SOLIDUS $this->inputStream->next(); goto again; default: $string .= $this->consumeEscapedCodePoint(); goto again; } }

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)
7.3.110.0090.00614.45
7.3.100.0160.00414.71
7.3.90.0090.01014.52
7.3.80.0090.00614.64
7.3.70.0040.01114.41
7.3.60.0110.00314.46
7.3.50.0070.00714.36
7.3.40.0120.00314.46
7.3.30.0130.00314.60
7.3.20.0080.01216.31
7.3.10.0040.01016.59
7.3.00.0060.00916.62
7.2.240.0160.00014.75
7.2.230.0150.00614.68
7.2.220.0060.00914.79
7.2.210.0090.00614.65
7.2.200.0110.00414.54
7.2.190.0030.01214.57
7.2.180.0100.00714.75
7.2.170.0060.01314.52
7.2.160.0090.00614.89
7.2.150.0080.00816.72
7.2.140.0030.01216.57
7.2.130.0170.00316.63
7.2.120.0110.00316.74
7.2.110.0060.00916.31
7.2.100.0080.00716.59
7.2.90.0130.00316.43
7.2.80.0070.01016.66
7.2.70.0060.00916.86
7.2.60.0030.01416.82
7.2.50.0080.00816.59
7.2.40.0110.00316.46
7.2.30.0030.01016.66
7.2.20.0100.00516.43
7.2.10.0130.00316.39
7.2.00.0090.00616.63
7.1.330.0060.01215.64
7.1.320.0060.01215.40
7.1.310.0060.00915.43
7.1.300.0070.00715.61
7.1.290.0110.00415.53
7.1.280.0150.00015.68
7.1.270.0030.01615.30
7.1.260.0110.00415.48
7.1.250.0060.01215.30

preferences:
146.41 ms | 995 KiB | 7 Q