Phasis
Compatibility

Spec surface

Phasis targets the current ECMAScript specification (ES2024+) and tracks TC39 proposals at Stage 3 and above. This page is the human-readable index of what's actually shipped.

Language

FeatureStatus
Lexical declarations (let, const) with TDZ
Block scope, function scope, module scope
Arrow functions (with lexical this)
Default parameters, rest parameters, spread
Destructuring (array, object, nested, defaults, rest)
Template literals, tagged templates
Computed property names
Shorthand properties and methods
Classes — constructors, methods, getters/setters, static
Class fields (public, private, static)
Private methods and accessors
super in methods and constructors
Decorators (Stage 3)
Static initializer blocks
Optional chaining (?.), nullish coalescing (??)
Logical assignment operators (&&=, ||=, ??=)
Numeric separators (1_000_000)
BigInt literals (123n) and operators
Async functions, async generators, top-level await
Generators (sync and async)
for…of, for…in, for await…of
Iterators and iterables (Symbol.iterator)
Symbol primitives and well-known symbols
ES Modules (import / export, dynamic import())
import.meta
import attributes (Stage 3)
Strict mode + Annex B legacy behaviours
Regular expressions (/u, /v, /d, named groups, lookbehind)
Automatic semicolon insertion (ASI)
Hashbang grammar (#!/usr/bin/env phasis)

Standard library

Fundamental

ObjectCoverage
Objectfull — keys, values, entries, assign, create, freeze, seal, getOwnPropertyDescriptor(s), setPrototypeOf, getOwnPropertyNames, getOwnPropertySymbols, hasOwn, groupBy, fromEntries, etc.
Arrayfull — every prototype method including at, flatMap, flat, findLast, findLastIndex, toReversed, toSorted, toSpliced, with, group, groupToMap
Stringfull — at, codePointAt, match, matchAll, replaceAll, padStart, padEnd, trimStart, trimEnd, isWellFormed, toWellFormed
Numberfull — isFinite, isInteger, isNaN, isSafeInteger, EPSILON, MAX_SAFE_INTEGER, etc.
BigIntfull — arbitrary-precision via bcmath
Booleanfull
Mathfull — every method, every special-case for NaN / Infinity / -0
JSONfull — parse, stringify, custom replacers, reviver, indentation
Symbolfull — for, keyFor, all well-known symbols, Symbol.toPrimitive
Functionfull — call, apply, bind, length, name, prototype semantics

Collections

ObjectCoverage
Mapfull — including groupBy and live iteration
Setfull — including intersection, union, difference, symmetricDifference, isSubsetOf, isSupersetOf, isDisjointFrom
WeakMap, WeakSet, WeakRef, FinalizationRegistryfull

Async

ObjectCoverage
Promisefull — all, race, any, allSettled, withResolvers, async iteration
AsyncIterator, AsyncGeneratorfull
Microtask scheduling

Binary data

ObjectCoverage
ArrayBuffer, SharedArrayBufferfull
DataViewfull — getBigInt64, setBigInt64, etc.
Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, BigInt64Array, BigUint64Array, Float16Array, Float32Array, Float64Arrayfull
Atomicsadd, sub, and, or, xor, compareExchange, exchange, isLockFree, load, notify, pause, store, wait, waitAsyncfull (single-agent only)

Reflection and proxies

ObjectCoverage
Proxyall 13 traps, revocable
Reflectall 14 static methods

Errors

ObjectCoverage
Error, TypeError, RangeError, ReferenceError, SyntaxError, URIError, EvalErrorfull
AggregateErrorfull
SuppressedError (Stage 3 explicit resource management)full

Dates and time

ObjectCoverage
Datefull
Temporal (Stage 3)full — Now, Instant, PlainDate, PlainTime, PlainDateTime, PlainYearMonth, PlainMonthDay, ZonedDateTime, Duration, TimeZone, Calendar (incl. Hebrew, Chinese, Dangi, Ethiopic, etc.)

Internationalisation

ObjectCoverage
Intl.Locale, Intl.Collator, Intl.DateTimeFormat, Intl.NumberFormat, Intl.PluralRules, Intl.RelativeTimeFormat, Intl.ListFormat, Intl.DisplayNames, Intl.Segmenterfull (delegates to PHP's intl extension when available)

Resource management

ObjectCoverage
DisposableStack, AsyncDisposableStack (Stage 3)full
Symbol.dispose, Symbol.asyncDisposefull
using / await using declarationsfull

Other

ObjectCoverage
RegExp (incl. /v set notation, named captures, lookaround, sticky/global flags)full
Iterator helpers (Stage 3) — map, filter, take, drop, flatMap, reduce, toArray, forEach, some, every, findfull
ShadowRealm (Stage 3)full
globalThis

What's not yet implemented

  • SharedArrayBuffer worker semantics beyond a single agent — multi-thread atomic notification across real OS threads requires pcntl and isn't on the roadmap. Single-agent atomics work.
  • Intl.Segmenter with grapheme clusters that need ICU 76+ — depends on the host PHP's intl extension version.
  • Tail call optimization — proper tail calls (PTC) are optional in the spec; we don't implement them.

Versioning

Phasis follows semver. The version line tracks ECMAScript spec drafts:

Phasis versionSpec targetStage 3 proposals
0.xES2024decorators, Temporal, explicit resource management, iterator helpers, set methods

A bump to 1.0 is gated on every Stage 4 proposal in the ES2025 draft being implemented and on a stable Promise drain semantics.

On this page