indexed by source hash */ private array $sourceHashToAst = []; public function __construct(private Parser $wrappedParser) { } public function parse(string $code, ErrorHandler|null $errorHandler = null): array|null { // note: this code is mathematically buggy by default, as we are using a hash to identify // cache entries. The string length is added to further reduce likeliness (although // already imperceptible) of key collisions. // In the "real world", this code will work just fine. $hash = sprintf('%s:%d', hash('sha256', $code), strlen($code)); if (array_key_exists($hash, $this->sourceHashToAst)) { /** @var Node\Stmt[]|null $ast */ $ast = unserialize($this->sourceHashToAst[$hash]); return $ast; } $ast = $this->wrappedParser->parse($code, $errorHandler); $this->sourceHashToAst[$hash] = serialize($ast); return $ast; } } __halt_compiler();----SIGNATURE:----lFIQ5BCUrO0p1EXES+vfcaln1FdkI9V5IGznZWHvX1L+PJrnQp1va76wzcYsCi792FutCI4HgCD5l2cvB+V1muGhYp9nGrbj1b4u+dhxl1btNcFO/bXhAnzYdzEp3XopAmab22aHmyTVlBZHFGatx2tFqpnTeEXae5p0ZwTzrf5w57P54xhaJem3p1LD4WKQ2jye3V5DPmvJruJsCKZzqoLa+fDnNGr4bKYTugJybya+G2oRsIP1OmPD06lW82a5wpu+1i3lpQ24oyM18/doi5Htt/oyvXB26BVog3MrL70vDX+Gad2t2yLk9lNYUuBm1Je2uqOGu0RZQrD1axdbqU54D6OJudu0wKPvTFR60ehBU3QdVbg9tykIiNNf040+aWBnVbYCye9TirbHTrTkk8EpnNiU1tz3l+qscFE/A0drK9bMvdOYGcU6R+R091vJjs+a1mCCCcTJ89+Qy9Qpzudyj1hIjOw3Kch5qhE16/urfJjvR32pvS+MEQAKHQK/yXhwfGTUy5obsLohahEOPjALBDVbkK7k78RHibJMT5wtbjLrQxPoqWwWzMbsD9T4GJ378//tATOySoIvIMGmHxhkNveKk9PFwtwaS2UqSYprIIHH9vgHuwI34PIgPCqdBhfzvjbYg0hZ2LKGljjWVLIhnfoL4/LQ0SIYhiBkGb8=----ATTACHMENT:----NzE0ODIxOTE3MTg5MzgzMyA3Njk2MDEwOTU5MDEwNTMxIDM5ODcwMzA2MzMwOTM0NTk=