---
title: "doctrine/lexer 3.0.0 Breaking Changes on Packagist"
description: "What each doctrine/lexer release removed, renamed or changed: 23 breaking changes in 2 versions on Packagist, each with its source."
canonical_url: https://since.dev/packages/packagist/doctrine/lexer
last_updated: 2026-12-04
---

# 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

Latest version `3.0.3`, released October 1, 2026. MIT license. [Source repository](https://github.com/doctrine/lexer)

Its 3.0.0 release requires [PHP 8.1](https://since.dev/calendar/php/8.1.md) or later. [PHP end of life dates](https://since.dev/calendar/php.md).

- From [2.0.0](#v-2-0-0) to [3.0.0](#v-3-0-0): 22 breaking changes in 1 version.

## doctrine/lexer 3.0.0 breaking changes

doctrine/lexer 3.0.0, released December 17, 2022: 22 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](https://github.com/doctrine/lexer/releases/tag/3.0.0)
- **Removed**  

The release removes the deprecation layer. Code that relied on the deprecated behaviour must be updated. [github.com](https://github.com/doctrine/lexer/releases/tag/3.0.0)
- **Removed** `Doctrine\Common\Lexer\Token::offsetExists`  

Doctrine\\Common\\Lexer\\Token::offsetExists was removed in doctrine/lexer 3.0.0 [packagist.org](https://packagist.org/packages/doctrine/lexer#3.0.0)
- **Removed** `Doctrine\Common\Lexer\Token::offsetGet`  

Doctrine\\Common\\Lexer\\Token::offsetGet was removed in doctrine/lexer 3.0.0 [packagist.org](https://packagist.org/packages/doctrine/lexer#3.0.0)
- **Removed** `Doctrine\Common\Lexer\Token::offsetSet`  

Doctrine\\Common\\Lexer\\Token::offsetSet was removed in doctrine/lexer 3.0.0 [packagist.org](https://packagist.org/packages/doctrine/lexer#3.0.0)
- **Removed** `Doctrine\Common\Lexer\Token::offsetUnset`  

Doctrine\\Common\\Lexer\\Token::offsetUnset was removed in doctrine/lexer 3.0.0 [packagist.org](https://packagist.org/packages/doctrine/lexer#3.0.0)
- **Configuration changed**  

The package no longer supports PHP below 8.1, so projects on older PHP must upgrade before using this version. [github.com](https://github.com/doctrine/lexer/releases/tag/3.0.0)
- **Signature changed** `Doctrine\Common\Lexer\AbstractLexer::$lookahead`  

Was public $lookahead; now public Token|null $lookahead. [packagist.org](https://packagist.org/packages/doctrine/lexer#3.0.0)
- **Signature changed** `Doctrine\Common\Lexer\AbstractLexer::$token`  

Was public $token; now public Token|null $token. [packagist.org](https://packagist.org/packages/doctrine/lexer#3.0.0)
- **Signature changed** `Doctrine\Common\Lexer\AbstractLexer::getInputUntilPosition`  

Was public function getInputUntilPosition($position); now public function getInputUntilPosition(int $position). [packagist.org](https://packagist.org/packages/doctrine/lexer#3.0.0)
- **Signature changed** `Doctrine\Common\Lexer\AbstractLexer::getLiteral`  

Was public function getLiteral($token); now public function getLiteral(int|string|UnitEnum $token). [packagist.org](https://packagist.org/packages/doctrine/lexer#3.0.0)
- **Signature changed** `Doctrine\Common\Lexer\AbstractLexer::getType`  

Was abstract protected function getType(&$value); now abstract protected function getType(string &$value). [packagist.org](https://packagist.org/packages/doctrine/lexer#3.0.0)
- **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](https://packagist.org/packages/doctrine/lexer#3.0.0)
- **Signature changed** `Doctrine\Common\Lexer\AbstractLexer::isNextToken`  

Was public function isNextToken($type); now public function isNextToken(int|string|UnitEnum $type). [packagist.org](https://packagist.org/packages/doctrine/lexer#3.0.0)
- **Signature changed** `Doctrine\Common\Lexer\AbstractLexer::resetPosition`  

Was public function resetPosition($position = 0); now public function resetPosition(int $position = 0). [packagist.org](https://packagist.org/packages/doctrine/lexer#3.0.0)
- **Signature changed** `Doctrine\Common\Lexer\AbstractLexer::scan`  

Was protected function scan($input); now protected function scan(string $input). [packagist.org](https://packagist.org/packages/doctrine/lexer#3.0.0)
- **Signature changed** `Doctrine\Common\Lexer\AbstractLexer::setInput`  

Was public function setInput($input); now public function setInput(string $input). [packagist.org](https://packagist.org/packages/doctrine/lexer#3.0.0)
- **Signature changed** `Doctrine\Common\Lexer\AbstractLexer::skipUntil`  

Was public function skipUntil($type); now public function skipUntil(int|string|UnitEnum $type). [packagist.org](https://packagist.org/packages/doctrine/lexer#3.0.0)
- **Signature changed** `Doctrine\Common\Lexer\Token`  

Was final class Token implements ArrayAccess; now final class Token. [packagist.org](https://packagist.org/packages/doctrine/lexer#3.0.0)
- **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](https://packagist.org/packages/doctrine/lexer#3.0.0)
- **Signature changed** `Doctrine\Common\Lexer\Token::$position`  

Was public $position; now public int $position. [packagist.org](https://packagist.org/packages/doctrine/lexer#3.0.0)
- **Signature changed** `Doctrine\Common\Lexer\Token::$value`  

Was public $value; now public string|int $value. [packagist.org](https://packagist.org/packages/doctrine/lexer#3.0.0)

## doctrine/lexer 2.0.0 breaking changes

doctrine/lexer 2.0.0, released December 11, 2022: 1 breaking change.

- **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](https://github.com/doctrine/lexer/releases/tag/2.0.0)

## Related packages

- [doctrine/annotations](https://since.dev/packages/packagist/doctrine/annotations.md)
- [doctrine/coding-standard](https://since.dev/packages/packagist/doctrine/coding-standard.md)
- [doctrine/collections](https://since.dev/packages/packagist/doctrine/collections.md)
- [doctrine/dbal](https://since.dev/packages/packagist/doctrine/dbal.md)
- [doctrine/doctrine-bundle](https://since.dev/packages/packagist/doctrine/doctrine-bundle.md)
- [doctrine/doctrine-fixtures-bundle](https://since.dev/packages/packagist/doctrine/doctrine-fixtures-bundle.md)

## Check your code

These are the changes. To see which of them reach your code, [scan a public repository](https://since.dev/scan.md), or have your coding agent call `check_code` with your manifest or lockfile over [MCP](https://since.dev/docs.md#mcp). [The API](https://since.dev/docs.md#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.

[Scan a repository](https://since.dev/scan.md). Any public GitHub repository. No sign-in.

### Tell your agent what changed since it was trained.

`claude mcp add --transport http since https://api.since.dev/mcp`

[Get an API key](https://app.since.dev/login?mode=signup)

Codex, Cursor and any MCP client use https://api.since.dev/mcp.

---

Every page on this site as Markdown: https://since.dev/sitemap.md. For agents: https://since.dev/llms.txt.
