doctrine/lexer breaking changes
doctrine/lexer 3.0.0 (December 17, 2022) is its newest release with breaking changes, 22 of them. The first: Removes the backwards-compatibility layer in doctrine/lexer 3.0.0. Every breaking API change we have recorded in doctrine/lexer on Packagist: 23 breaking changes in 2 versions. Below, its 2 versions with breaking changes, newest first, removals and renames first, each with its source.
Updated December 4, 2026
On this page
Latest version 3.0.3, released October 1, 2026. MIT license. Source repository
Its 3.0.0 release requires PHP 8.1 or later. PHP end of life dates.
doctrine/lexer 3.0.0 breaking changes
- Removed
The release removes the rules related to the BC layer. Code that depends on that compatibility layer must be updated. github.com - Removed
The release removes the deprecation layer. Code that relied on the deprecated behaviour must be updated. github.com - Removed
Doctrine\Common\Lexer\Token::offsetExists
Doctrine\Common\Lexer\Token::offsetExists was removed in doctrine/lexer 3.0.0 packagist.org - Removed
Doctrine\Common\Lexer\Token::offsetGet
Doctrine\Common\Lexer\Token::offsetGet was removed in doctrine/lexer 3.0.0 packagist.org - Removed
Doctrine\Common\Lexer\Token::offsetSet
Doctrine\Common\Lexer\Token::offsetSet was removed in doctrine/lexer 3.0.0 packagist.org - Removed
Doctrine\Common\Lexer\Token::offsetUnset
Doctrine\Common\Lexer\Token::offsetUnset was removed in doctrine/lexer 3.0.0 packagist.org - Configuration changed
The package no longer supports PHP below 8.1, so projects on older PHP must upgrade before using this version. github.com - Signature changed
Doctrine\Common\Lexer\AbstractLexer::$lookahead
Was public $lookahead; now public Token|null $lookahead. packagist.org - Signature changed
Doctrine\Common\Lexer\AbstractLexer::$token
Was public $token; now public Token|null $token. packagist.org - Signature changed
Doctrine\Common\Lexer\AbstractLexer::getInputUntilPosition
Was public function getInputUntilPosition($position); now public function getInputUntilPosition(int $position). packagist.org - Signature changed
Doctrine\Common\Lexer\AbstractLexer::getLiteral
Was public function getLiteral($token); now public function getLiteral(int|string|UnitEnum $token). packagist.org - Signature changed
Doctrine\Common\Lexer\AbstractLexer::getType
Was abstract protected function getType(&$value); now abstract protected function getType(string &$value). packagist.org - Signature changed
Doctrine\Common\Lexer\AbstractLexer::isA
Was public function isA($value, $token); now public function isA(string $value, int|string|UnitEnum $token). packagist.org - Signature changed
Doctrine\Common\Lexer\AbstractLexer::isNextToken
Was public function isNextToken($type); now public function isNextToken(int|string|UnitEnum $type). packagist.org - Signature changed
Doctrine\Common\Lexer\AbstractLexer::resetPosition
Was public function resetPosition($position = 0); now public function resetPosition(int $position = 0). packagist.org - Signature changed
Doctrine\Common\Lexer\AbstractLexer::scan
Was protected function scan($input); now protected function scan(string $input). packagist.org - Signature changed
Doctrine\Common\Lexer\AbstractLexer::setInput
Was public function setInput($input); now public function setInput(string $input). packagist.org - Signature changed
Doctrine\Common\Lexer\AbstractLexer::skipUntil
Was public function skipUntil($type); now public function skipUntil(int|string|UnitEnum $type). packagist.org - Signature changed
Doctrine\Common\Lexer\Token
Was final class Token implements ArrayAccess; now final class Token. packagist.org - Signature changed
Doctrine\Common\Lexer\Token::__construct
Was public function __construct($value, $type, int $position); now public function __construct(string|int $value, $type, int $position). packagist.org - Signature changed
Doctrine\Common\Lexer\Token::$position
Was public $position; now public int $position. packagist.org - Signature changed
Doctrine\Common\Lexer\Token::$value
Was public $value; now public string|int $value. packagist.org
doctrine/lexer 2.0.0 breaking changes
- Signature changed
Tokens are now instances of a class instead of object-like arrays, so code that reads token data as array values must be updated. github.com
Related packages
- doctrine/annotations
- doctrine/coding-standard
- doctrine/collections
- doctrine/dbal
- doctrine/doctrine-bundle
- doctrine/doctrine-fixtures-bundle
Check your code
These are the changes. To see which of them reach your code, scan a public repository, or have your coding agent call check_code with your manifest or lockfile over MCP. The API reads every change in every version. A fix pull request opens for the changes that reach a connected repository. Nothing merges or deploys.

Put your code on continuous maintenance.
Scan a public repository now, or give your agent one line.
See how out of date your code is.
Tell your agent what changed since it was trained.
claude mcp add --transport http since https://api.since.dev/mcpCodex, Cursor and any MCP client use https://api.since.dev/mcp.