Executing a simple select query return this error :
request.CRITICAL: Uncaught PHP Exception ErrorException: "Notice: Trying to access array offset on value of type null" at C:\Applications\wamp64\www\application\vendor\doctrine\orm\lib\Doctrine\ORM\Query\Parser.php line 1576 {"exception":"[object] (ErrorException(code: 0): Notice: Trying to access array offset on value of type null at C:\\Applications\\wamp64\\www\\application\\vendor\\doctrine\\orm\\lib\\Doctrine\\ORM\\Query\\Parser.php:1576)"} []
Bug Report
Executing a simple select query return this error :
request.CRITICAL: Uncaught PHP Exception ErrorException: "Notice: Trying to access array offset on value of type null" at C:\Applications\wamp64\www\application\vendor\doctrine\orm\lib\Doctrine\ORM\Query\Parser.php line 1576 {"exception":"[object] (ErrorException(code: 0): Notice: Trying to access array offset on value of type null at C:\\Applications\\wamp64\\www\\application\\vendor\\doctrine\\orm\\lib\\Doctrine\\ORM\\Query\\Parser.php:1576)"} []
Summary
Since the
Lexer::$lookahead
property is nullable, we should have a check on this line https://github.com/doctrine/orm/blob/2.10.x/lib/Doctrine/ORM/Query/Parser.php#L1562 (and maybe others !) (the same code remains in the last version)An old merge request fix the same bug in another file : https://github.com/doctrine/orm/pull/7934/files
Current behavior
How to reproduce
Expected behavior