01
- Inline HTML mixed with PHP is not supported; files are treated as pure PHP code
- The transpiler assumes each file is a self-contained PHP script
- Comments (//, #, /* */, /** */) are parsed but not carried over to JS output
- Type declarations are dropped at transpile time (types on parameters, properties, and return values are not carried over to JS; some information is preserved in reflection data)
- null is fully supported
- Booleans are fully supported
- int and float are fully supported as distinct PHP types; the runtime preserves the type tag so is_int, is_float, gettype, and coercion rules behave identically to PHP
- Strings are fully supported
- Arrays and objects are fully supported
- Resources and callables are fully supported
- self, static, parent type references are fully supported
- Iterables are fully supported PHP 7.1
- Type juggling (loose comparisons and coercions) is fully supported
- Standard variable declaration and assignment
- Pass-by-reference (&$var) fully supported
- Variable variables ($$name) supported
- global and static variable keywords
- Proper scope isolation between functions and global scope
- isset(), unset(), empty(), define() language constructs fully supported
- define() and const declarations
- Class constants and interface constants
- Magic constants: __FILE__, __LINE__, __CLASS__, __FUNCTION__, __METHOD__, __NAMESPACE__, __DIR__
- Arithmetic: +, -, *, /, %, ** (exponentiation)
- Comparison: ==, ===, !=, !==, <, >, <=, >=, <=> (spaceship)
- Logical: &&, ||, !, and, or, xor
- Bitwise: &, |, ^, ~, <<, >>
- String concatenation (.) and concatenation assignment (.=)
- Increment/decrement: ++$a, $a++, --$a, $a--
- Assignment: by reference (=&), arithmetic (+=, -=, *=, /=, %=, **=), bitwise (&=, |=, ^=, <<=, >>=), string (.=), and nested assignments
- Null coalescing: ?? introduced in 7.0, ??= in 7.4; spread (...) introduced in 5.6 PHP 7.0
- Not supported: execution operator (backtick), pipe operator (|>) In Progress
- if / elseif / else and ternary (?:)
- switch and match expressions (with strict comparison) PHP 8.0
- for, foreach (with key-value unpacking), while, do-while
- break and continue, including level argument (break 2)
- return with and without values
- File inclusion: include, include_once, require, require_once
- Not supported: goto, declare
- Named functions and methods
- Closures with use() bindings (by value and by reference)
- Arrow functions (fn() =>) and anonymous functions (function() {}) PHP 7.4
- Variadic arguments (...$args)
- Named arguments are preprocessed at transpile time into positional arguments; dynamic function invocation with named arguments is not supported PHP 8.0
- Default parameter values and nullable parameters
- First-class callable syntax PHP 8.1
- Properties and class constants are supported
- Property and method visibility (public, protected, private) is not enforced at runtime
- Property hooks are not yet supported In Progress PHP 8.4
- Autoloading is fully supported
- Inheritance is fully supported
- Scope resolution (::) is fully supported
- Interfaces are partially supported: present in reflection data but their types are not enforced
- Traits are fully supported
- Anonymous classes are minimally supported PHP 7.0
- Overloading is supported
- Object iteration is supported
- Magic methods: __get, __set, __construct, __destruct, __isset, __unset, __invoke, __toString are supported; others are partially supported
- Object destructors (__destruct) fire deterministically on scope exit: the runtime tracks reference counts and invokes __destruct when an object reaches zero references, matching PHP's lifecycle semantics New
- final keyword is dropped at transpile time
- Late static binding is supported
- Object references are fully supported, including referencing object properties by reference New
- Cloning and comparing are minimally supported In Progress
- Object serialization is minimally supported
- Lazy objects are not supported PHP 8.4
- Predefined interfaces and classes (Countable, Iterator, ArrayAccess, Stringable, etc.) are supported PHP 8.0
- Namespaces are fully supported at runtime
- Sub-namespaces with arbitrary depth are fully supported
- Integration with dynamic features (dynamic class instantiation, function calls, etc.) is supported
- Aliasing via use ... as ... is supported
- Fallback to global scope for unqualified names is supported
- try / catch (multi-catch with |) / finally PHP 8.0
- Custom exception class hierarchies
- set_error_handler and set_exception_handler
- trigger_error and PHP error level constants
- Throwable interface and Error base class PHP 7.0
- Predefined exceptions (RuntimeException, InvalidArgumentException, LogicException, etc.) are supported
- Passing by reference (&$var in function signatures) is supported
- Copy on write semantics are supported
- Returning references from functions is not yet supported In Progress
- Unsetting references (unset($ref)) is not yet supported In Progress
- yield by value and by reference
- yield from and generator delegation PHP 7.0
- Generator::send() and Generator::throw() In Progress
- Return values from generators (Generator::getReturn()) In Progress PHP 7.0
- #[Attribute] declaration syntax PHP 8.0
- Attribute targeting: class, method, property, parameter, function, constant PHP 8.0
- Runtime access via ReflectionAttribute PHP 8.0
- Repeatable attributes PHP 8.0
- Predefined attributes: #[SensitiveParameter] (8.2), #[Override] and #[Deprecated] (8.3) PHP 8.2
- Trait composition (use Trait)
- Abstract trait methods
- Trait constants PHP 8.2
- Basic (unit) enums PHP 8.1
- Backed enums (string and int) PHP 8.1
- Enum methods and constants PHP 8.1
- Runtime constants: PHP_INT_MAX, PHP_INT_MIN, PHP_FLOAT_MAX, PHP_EOL, PHP_MAJOR_VERSION, PHP_VERSION, and more
- true, false, null literals
- Web server superglobals not available: $_SERVER, $_GET, $_POST, $_FILES, $_SESSION, $_COOKIE In Progress
- Pext does not currently embed a web server runtime
- PHP 8.1 Fibers are not currently supported
- Lightweight concurrency primitives are not yet part of the Pext runtime
02
- array_map, array_filter, array_reduce, array_walk
- array_merge, array_slice, array_splice, array_chunk, array_combine
- Sorting: sort, rsort, usort, ksort, uasort, array_multisort
- array_key_exists, in_array, array_search, array_unique, array_flip
- array_push, array_pop, array_shift, array_unshift
- compact and extract
- Arbitrary precision arithmetic fully supported with PHP-identical scale handling
- bcadd, bcsub, bcmul, bcdiv, bcmod, bcdivmod
- bcpow, bcpowmod, bcsqrt
- bccomp for arbitrary-precision comparison
- bcscale for reading and setting the global default scale
- bcceil, bcfloor, bcround PHP 8.4
- ctype_alpha, ctype_alnum, ctype_digit, ctype_xdigit
- ctype_lower, ctype_upper, ctype_space
- ctype_punct, ctype_print, ctype_graph, ctype_cntrl
- Byte-classification semantics matching PHP
- DateTime and DateTimeImmutable classes
- DateInterval and DatePeriod
- date, strtotime, mktime, time, microtime, checkdate
- date_create, date_format, date_diff, date_add, date_sub
- Directory class with read, rewind, close instance methods
- dir() factory returning a Directory handle
- chdir() for changing the working directory
- Pairs with the File System module for full PHP filesystem coverage
- DOMDocument, DOMElement, DOMAttr, DOMText nodes supported
- DOMXPath queries supported
- createElement, appendChild, getElementById, getElementsByTagName
- loadHTML, loadXML, saveHTML, saveXML
- Some advanced DOM manipulation methods are in progress In Progress
- error_reporting, set_error_handler, restore_error_handler
- set_exception_handler, restore_exception_handler
- trigger_error, user_error
- error_get_last, error_clear_last
- FileHandlingError
- FileInfo
- FileObject
- file_get_contents, file_put_contents, file_exists, file
- mkdir, rmdir, rename, copy, unlink, symlink
- opendir, readdir, closedir, scandir, glob
- is_file, is_dir, is_readable, is_writable, filesize, filemtime
- realpath, dirname, basename, pathinfo
- filter_var and filter_var_array for one-shot validation and sanitization
- filter_input and filter_input_array for GET, POST, COOKIE, SERVER, ENV
- filter_has_var, filter_id, filter_list
- Validate filters: FILTER_VALIDATE_INT, FLOAT, BOOL, EMAIL, URL, IP, REGEXP, DOMAIN, MAC
- Sanitize filters: FILTER_SANITIZE_STRING, EMAIL, URL, NUMBER_INT, NUMBER_FLOAT, SPECIAL_CHARS
- Full option and flag set, including FILTER_NULL_ON_FAILURE and FILTER_FORCE_ARRAY
- The GMP extension is not currently supported
- For arbitrary precision arithmetic, use BCMath or brick/math
- PHP_VERSION, PHP_MAJOR_VERSION, PHP_OS, PHP_INT_MAX, PHP_EOL, and similar constants
- phpversion(), php_uname(), ini_get(), ini_set() supported
- phpinfo() and web-server-related info functions not available
- Locale class for locale parsing, composition, and matching
- Transliterator with ICU-style id and rule-based transliteration
- Normalizer for NFC, NFD, NFKC, NFKD
- MessageFormatter for ICU MessageFormat
- Spoofchecker for confusable detection
- idn_to_ascii and idn_to_utf8 for internationalized domain names
- Iterator and IteratorAggregate interfaces
- ArrayIterator, ArrayObject
- SplStack, SplQueue, SplHeap, SplMinHeap, SplMaxHeap
- SplDoublyLinkedList, SplFixedArray
- RecursiveIterator and RecursiveIteratorIterator
- json_encode with all flags (JSON_PRETTY_PRINT, JSON_UNESCAPED_UNICODE, JSON_THROW_ON_ERROR, etc.)
- json_decode with associative array and object modes
- json_last_error, json_last_error_msg
- json_validate PHP 8.3
- libxml_use_internal_errors, libxml_get_errors, libxml_clear_errors
- LIBXML_* constants supported
- Some advanced libxml options are in progress In Progress
- Arithmetic: abs, max, min, pow, sqrt, hypot, intdiv, fmod, fdiv
- Rounding: ceil, floor, round
- Trigonometric: sin, cos, tan, asin, acos, atan, atan2, deg2rad, rad2deg, pi
- Hyperbolic: sinh, cosh, tanh, asinh, acosh, atanh
- Exponential and logarithmic: exp, expm1, log, log10, log1p
- Base conversion: bindec, decbin, hexdec, dechex, octdec, decoct, base_convert
- Floating-point predicates: is_finite, is_infinite, is_nan
- RoundingMode enum: HalfAwayFromZero, HalfTowardsZero, HalfEven, HalfOdd, TowardsZero, AwayFromZero, NegativeInfinity, PositiveInfinity PHP 8.4
- Math constants: M_E, M_PI, M_PI_2, M_PI_4, M_1_PI, M_2_PI, M_SQRTPI, M_2_SQRTPI, M_SQRT2, M_SQRT3, M_SQRT1_2, M_LOG2E, M_LOG10E, M_LN2, M_LN10, M_LNPI, M_EULER, INF, NAN
- Rounding constants: PHP_ROUND_HALF_UP, PHP_ROUND_HALF_DOWN, PHP_ROUND_HALF_EVEN, PHP_ROUND_HALF_ODD
- mb_strlen, mb_strpos, mb_substr operating on codepoints rather than bytes
- mb_strtolower, mb_convert_case for Unicode case folding
- mb_chr for codepoint to character conversion
- mb_convert_encoding for encoding conversion across UTF-8, UTF-16, ISO-8859, and the common PHP aliases
- mb_detect_encoding, mb_internal_encoding, mb_language
- dns_get_record with A, AAAA, MX, TXT, NS, SOA, PTR, CNAME, CAA, SRV
- Synchronous resolution backed by a worker so user code keeps the PHP blocking semantics
- header, headers_sent, http_response_code for SAPI response control
- ob_start, ob_end_clean, ob_end_flush, ob_get_contents, ob_get_clean
- ob_flush, ob_get_level, ob_get_length
- echo, print, print_r, var_dump, var_export
- Output buffering tied to non-web runtime; some behaviors differ from PHP's web SAPI In Progress
- preg_match, preg_match_all, preg_replace, preg_replace_callback, preg_split
- Named capture groups, backreferences, lookahead/lookbehind
- PREG_OFFSET_CAPTURE, PREG_SET_ORDER, PREG_PATTERN_ORDER flags
- preg_quote, preg_last_error
- proc_open, proc_close, proc_get_status, proc_terminate
- passthru, exec, shell_exec, system
- popen, pclose
- pipes and stream handling for stdin/stdout/stderr In Progress
- mt_rand and rand using Mersenne Twister, seedable for reproducible runs
- random_int and random_bytes backed by a cryptographically secure source
- mt_getrandmax, mt_srand, srand
- ReflectionClass: name, methods, properties, constants, interfaces, traits
- ReflectionMethod, ReflectionProperty, ReflectionParameter
- ReflectionFunction, ReflectionExtension
- ReflectionAttribute for reading #[Attributes] at runtime PHP 8.0
- Some advanced reflection capabilities (closures, generators) are in progress In Progress
- session_start, session_destroy, session_commit, session_abort, session_reset
- session_id, session_name, session_status, session_regenerate_id, session_create_id
- session_encode, session_decode for PHP-compatible serialization
- session_set_save_handler and SessionHandlerInterface for custom backends
- session_get_cookie_params, session_set_cookie_params, session_cache_limiter, session_cache_expire
- session_gc, session_save_path, session_module_name, session_register_shutdown, session_unset, session_write_close
- SimpleXMLElement and SimpleXMLIterator with PHP-style property and child access
- simplexml_load_string, simplexml_load_file, simplexml_import_dom
- xpath() queries and attribute access via attributes()
- asXML for serialization back to XML
- stream_context_create plus the full get_options, set_option, params family
- stream_get_contents, stream_get_line, stream_get_meta_data, stream_copy_to_stream
- stream_socket_client, stream_socket_server, stream_socket_accept, stream_socket_sendto, stream_socket_recvfrom
- stream_socket_enable_crypto for TLS upgrades
- stream_filter_register, stream_filter_append, stream_filter_prepend, stream_filter_remove
- stream_wrapper_register, stream_wrapper_unregister, stream_wrapper_restore
- stream_select, stream_set_blocking, stream_set_timeout, stream_set_chunk_size
- Some advanced wrapper protocols are still in progress In Progress
- str_replace, str_contains, str_starts_with, str_ends_with, substr, strpos, strlen
- explode, implode, trim, ltrim, rtrim, str_pad, str_repeat, str_split
- strtolower, strtoupper, ucfirst, ucwords, lcfirst
- sprintf, printf, number_format, money_format
- Multibyte string functions (mb_*)
- str_contains, str_starts_with, str_ends_with PHP 8.0
- token_get_all for tokenizing PHP source into the standard T_* token stream
- token_name for resolving token IDs to their PHP names
- PhpToken class with tokenize, getTokenName, is, isIgnorable PHP 8.0
- Full T_* constant set covering the PHP 8.x language surface
- parse_url with the full PHP_URL_* component set
- urlencode, urldecode, rawurlencode, rawurldecode
- http_build_query with nested arrays and configurable separators
- base64_encode, base64_decode
- isset, empty, unset, is_null, is_bool, is_int, is_float, is_string, is_array, is_object
- gettype, settype, get_debug_type PHP 8.0
- intval, floatval, strval, boolval
- var_dump, var_export, print_r, serialize, unserialize
- is_numeric, is_callable, is_iterable, is_countable
- ZipArchive class for reading and writing zip archives
- open, close, addFile, addFromString, addEmptyDir
- extractTo, getFromName, getFromIndex, getNameIndex, statIndex
- deleteName, deleteIndex, renameName, renameIndex
- Full ZipArchive constant set (CREATE, OVERWRITE, EXCL, CHECKCONS, ER_*)