Skip to content

Commit

Permalink
Fix parse error
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrejmirtes committed Aug 26, 2024
1 parent bc90409 commit 8ef28f6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions extractor/extract.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 8ef28f6

Please sign in to comment.