Skip to content

Commit

Permalink
fallback to null when look up to invalid pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
cappuc committed Sep 4, 2023
1 parent edbf4ab commit 8634118
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Parse/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function idOrFalse(string $identifier): string|false

public function look(TokenType $type, int $offset = 0): bool
{
$token = $this->tokens[$this->pointer + $offset];
$token = $this->tokens[$this->pointer + $offset] ?? null;

if ($token === null) {
return false;
Expand Down

0 comments on commit 8634118

Please sign in to comment.