Migrate nikic/php-parser to TypeScript

C Runtime-assisted · version 5.7.0

nikic/php-parser 5.7.0 is a PHP package released under the BSD-3-Clause license and requires PHP >=7.4. Pext migrates it to TypeScript; on Node.js, 533 of 1,016 PHPUnit tests pass (52.4%), with 302 failures and 181 errors. It has no tracked dependencies, and 18 tracked packages depend on it.

A PHP parser written in PHP

ConvertsYes
Runs on Node.jsYes
Runs on BunNot yet measured
TypeScript typesNot emitted

PHPUnit results on Node.js

52.4% of 1,016 tests passing (533 passed, 302 failed, 181 errors, 0 skipped). Verified 2026-10-26.

Where tests fail

The 5 test classes with the most failing tests on Node.js:

Test classFailing tests
EmulativeTest273
ConstExprEvaluatorTest57
Php7Test54
Php8Test54
LexerTest10

The remaining 35 failing tests are spread across other classes.

What “Runtime-assisted” means

Runs and passes most of its tests, with the Pext runtime doing visible work to preserve PHP behaviour.

Requirements

PHP
>=7.4
Extensions
ctypejsontokenizer

As declared in the package's Composer metadata. Pext provides PHP extensions through its runtime modules.

Dependencies

No tracked dependencies.

Used by

More from nikic

Upstream

Version
5.7.0
License
BSD-3-Clause
Keywords
php, parser

Migrating a codebase that uses nikic/php-parser?

See how Pext migrates a real PHP application, its Composer dependencies and its test suite to TypeScript.