diff --git a/extractor/extract.php b/extractor/extract.php index 00ac4c0..44cf66b 100755 --- a/extractor/extract.php +++ b/extractor/extract.php @@ -251,6 +251,15 @@ public function clear(): void if ($stubContents === false) { throw new \LogicException('Could not read stub'); } + if (str_ends_with($stubPath, '/Zend/zend_builtin_functions.stub.php')) { + $stubContents = str_replace([ + 'function exit', + 'function die', + ], [ + 'function _exit', + 'function _die', + ], $stubContents); + } $ast = $this->parser->parse($stubContents); if ($ast === null) { throw new \LogicException('AST cannot be null');