Migrate sebastian/comparator to TypeScript

B Production-ready · version 7.1.6

sebastian/comparator 7.1.6 is a PHP package released under the BSD-3-Clause license and requires PHP >=8.3. Pext migrates it to TypeScript; on Node.js, 361 of 377 PHPUnit tests pass (95.7%), with 15 failures and 1 error. It depends on 2 tracked packages (weakest tier: Runtime-assisted), and 1 tracked package depends on it.

Provides the functionality to compare PHP values for equality

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

PHPUnit results on Node.js

95.7% of 377 tests passing (361 passed, 15 failed, 1 errors, 0 skipped). Verified 2026-10-23.

Where tests fail

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

Test classFailing tests
DOMNodeComparatorTest13
ClosureComparatorTest2
NumberComparatorTest1

What “Production-ready” means

Passes at least 80% of its original tests and behaves like the PHP original on the paths that matter. Remaining gaps are tracked.

Requirements

PHP
>=8.3
Extensions
dommbstring

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

Dependencies

Weakest dependency: C Runtime-assisted

Used by

More from sebastian

Upstream

Version
7.1.6
License
BSD-3-Clause
Homepage
https://github.com/sebastianbergmann/comparator
Keywords
comparator, compare, equality

Migrating a codebase that uses sebastian/comparator?

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