Phasis
Pure PHP JavaScript engine. Full ES2024+ at 100% test262, plus the Web Platform Pack (URL, encoding, structuredClone) and Fetch Pack (fetch, Streams, AbortSignal, Blob, FormData) at 100% WPT.
Pure PHP
No exec, no FFI. Runs anywhere PHP 8.2+ runs.
100% test262
Passes the entire official ECMAScript conformance suite — every test, every category, no skips.
Modern ECMAScript
Classes, async/await, generators, Symbol, BigInt, Proxy, Temporal, Intl, TypedArray. Full ES2024+.
Web Platform APIs
URL, TextEncoder/Decoder, atob/btoa, structuredClone, performance, DOMException — built-in.
fetch + Streams
Real HTTP from JS via ext-curl. Full Fetch API with AbortSignal, Blob, FormData, and WHATWG Streams.
100% WPT
Web Platform Tests for fetch, headers, blob, abort, streams, encoding — every imported subtest passes.
PHP ↔ JS Interop
Share objects without serialization. Bind PHP closures as JS functions. Zero-copy bridging.
Embeddable
One Engine class: eval, execFile, setGlobal, call. Drop into any PHP app or CLI.
Sandboxable
Resource limits for depth, loops, strings, output, wall clock. The host controls everything.
CLI Toolkit
bin/phasis runs scripts and ships a REPL. bin/test262 and bin/wpt measure conformance.
Oracle-Tested
Every change verified against Node.js (V8). test262 + WPT + popular libraries run in CI on every push.
Real Libraries
acorn, mustache.js, lodash, marked — all run byte-equal to Node. CI-gated on every push.
Run JavaScript inside PHP.
Install the Composer package and execute your first JS file from PHP in seconds.
Read the Docs