Search by

ondrejmirtes / phplrt-runtime

ondrejmirtes

phplrt runtime (lexer, parser, source, position and their contracts) downgraded to PHP 7.4

Package info

github.com/ondrejmirtes/phplrt-runtime

Homepage

pkg:composer/ondrejmirtes/phplrt-runtime

Statistics

Installs: 23 114

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

4.2.4.1 2026-10-26 17:32 UTC

This package is auto-updated.

Last update: 2026-10-26 17:32:46 UTC


README

The runtime half of phplrt (lexer, parser, source, position and their contracts), downgraded to PHP 7.4 so that PHPStan can run a parser generated by the phplrt compiler everywhere PHPStan runs.

It replaces phplrt/runtime and the packages it is made of. Only the runtime is here: grammars are compiled with upstream phplrt/compiler on a recent PHP.

How it is built

Every release is rebuilt from an upstream phplrt tag:

composer install --working-dir build/tools
git clone --branch 4.2.4 https://github.com/phplrt/phplrt.git /tmp/phplrt
build/build.sh /tmp/phplrt /tmp/phplrt-runtime

which creates these commits:

  1. the upstream sources, copied verbatim,
  2. manual changes Rector cannot do (build/manual.py): enums become singleton classes (Channel::Hidden()) and string constants, WeakMap becomes SplObjectStorage, and so on. It also applies build/interpreter.patch, which makes the recursive descent interpreter faster without changing what it reads,
  3. DowngradeLevelSetList::DOWN_TO_PHP_74 applied by Rector,
  4. this build tooling.

Versions follow upstream with a fourth number: 4.2.4.0 is upstream 4.2.4. The fourth number grows when the fork itself changes: 4.2.4.1 is upstream 4.2.4 with the interpreter patch.