zephir_parser

Zephir code parser.


Zephir Parser is a code parser, delivered as a C extension for the PHP language.

License: MIT

Latest releases

Version Release Download
2.2.0 2026-07-18 zephir_parser-2.2.0.tgz
2.1.0 2026-07-03 zephir_parser-2.1.0.tgz
2.0.4 2026-06-04 zephir_parser-2.0.4.tgz
2.0.3 2026-06-01 zephir_parser-2.0.3.tgz
2.0.2 2026-05-28 zephir_parser-2.0.2.tgz
Show all releases

Changelog

Version Message
2.2.0 ### Added
- Support the `::class` magic constant: `self::class`, `parent::class`, `static::class` and `ClassName::class` now parse into a `static-constant-access` node whose member value is `class`, which the compiler resolves to the fully-qualified class name ([zephir-lang/zephir#2527](https://github.com/zephir-lang/zephir/issues/2527)).
2.1.0 ### Added
- Add trait support: top-level `trait Name { }` declarations (AST `type: "trait"`) and in-class `use A, B;` statement. ([zephir-lang/php-zephir-parser#195](https://github.com/zephir-lang/php-zephir-parser/issues/195)).

### Changed
- `trait` is now a reserved keyword; identifiers named `trait` are a syntax error.
2.0.4 ### Fixed
- A `-` glued to a digit right after a value (e.g. `len-1`, `5-1`, `arr[0]-1`, `len -1`) is now scanned as the binary subtraction operator instead of the sign of a negative literal, which previously produced a `Syntax error`. Unary negative literals (after `=`, `(`, `,`, `return`, etc.) are unchanged, so parameter defaults, constants and array keys keep their negative-literal AST
([zephir-lang/zephir#2011](https://github.com/zephir-lang/zephir/issues/2011)).
2.0.3 ### Fixed
- `instanceof` now binds tighter than logical not, matching PHP — `!a instanceof b` parses as `!(a instanceof b)` instead of `(!a) instanceof b`.
2.0.2 ### Added
- Added grammar rules for variadic parameters (`...name` and `type ...name`). The parameter AST node now carries a `"variadic" => 1` flag so the compiler can generate variadic functions/methods
([zephir-lang/zephir#2025](https://github.com/zephir-lang/zephir/issues/2025)).
Show complete changelog