|
| 1 | +# Changelog |
| 2 | + |
| 3 | +All notable changes to php.rs are documented in this file. |
| 4 | + |
| 5 | +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). |
| 6 | + |
| 7 | +## [Unreleased] |
| 8 | + |
| 9 | +### Added |
| 10 | + |
| 11 | +**Core Interpreter (Phases 0-5)** |
| 12 | + |
| 13 | +- Cargo workspace with 85 crates covering the full PHP interpreter pipeline |
| 14 | +- ZVal 16-byte tagged union matching PHP's zval layout, with all PHP type variants |
| 15 | +- ZString with Arc-based refcounting, DJBX33A hashing, and string interning pool |
| 16 | +- ZArray with packed mode (Vec-backed for consecutive integer keys) and hash mode (Robin Hood open addressing) |
| 17 | +- ZObject with ClassEntry, property storage, and method lookup |
| 18 | +- ZReference with refcount and wrapped ZVal semantics |
| 19 | +- ZResource with type id, pointer, and destructor |
| 20 | +- Full type coercion system (int, float, string, bool, null, array) matching PHP semantics bit-for-bit |
| 21 | +- Hand-written lexer (re2c-equivalent) with double-quoted string interpolation |
| 22 | +- Recursive descent parser producing a full PHP 8.6 AST |
| 23 | +- AST-to-opcode compiler |
| 24 | +- Virtual machine executor with all 212 opcodes implemented, including: |
| 25 | + - Arithmetic, bitwise, comparison, and logical operators |
| 26 | + - String rope opcodes (RopeInit/RopeAdd/RopeEnd) |
| 27 | + - Object property and static property access, isset/unset |
| 28 | + - Array operations (InArray, ArrayKeyExists, AddArrayUnpack) |
| 29 | + - Function call machinery (FuncNumArgs, FuncGetArgs, named arguments, spread) |
| 30 | + - Error suppression (BeginSilence/EndSilence) |
| 31 | + - Introspection (GetClass, GetCalledClass, GetType) |
| 32 | + - Type verification (VerifyReturnType, VerifyNeverType, AssertCheck) |
| 33 | + - Switch dispatch (SwitchLong, SwitchString) |
| 34 | + - Static local variables (BindStatic) |
| 35 | +- Complete OOP system: classes, interfaces, abstract classes, enums, traits, inheritance, property type invariance |
| 36 | +- Fiber support for cooperative multitasking |
| 37 | +- DNF (Disjunctive Normal Form) types |
| 38 | +- goto/label control flow |
| 39 | +- declare/halt_compiler directives |
| 40 | +- Backtick execution operator |
| 41 | +- Strict types enforcement |
| 42 | +- Error handling matching PHP error levels (E_NOTICE, E_WARNING, E_ERROR, E_PARSE) |
| 43 | +- Object reference semantics via Rc<RefCell<>> |
| 44 | +- $GLOBALS superglobal support |
| 45 | +- PHPT test file parser and runner (--TEST--, --FILE--, --EXPECT--, --EXPECTF--, --SKIPIF--, --INI--, --ENV--, --ARGS--, --CLEAN--) |
| 46 | +- Criterion benchmark harness |
| 47 | + |
| 48 | +**Parser and Compiler (Phase 6)** |
| 49 | + |
| 50 | +- Property hooks compilation (get/set) as separate ZOpArrays with recursion guards |
| 51 | +- Asymmetric visibility parsing and enforcement (public private(set), protected(set)) |
| 52 | +- InitParentPropertyHookCall opcode for parent:: hook dispatch |
| 53 | +- DeclareAttributedConst opcode for PHP 8.5 attributed constants |
| 54 | +- Attributes on functions, methods, and parameters with target validation (Attribute::TARGET_*) |
| 55 | +- Named arguments with spread operator support (func(...$args, name: $val)) |
| 56 | + |
| 57 | +**Standard Library (Phase 7)** |
| 58 | + |
| 59 | +- list() and short array destructuring ([...] = $array) via FetchListR/FetchListW opcodes |
| 60 | +- Stream functions: stream_filter_append/prepend, stream_socket_client/server, stream_select, stream_set_blocking/timeout, stream_wrapper_register |
| 61 | +- proc_open with full descriptor spec (pipes, files), proc_close, proc_get_status, proc_terminate, proc_nice |
| 62 | +- php://input stream support |
| 63 | +- Real output buffering with ob_stack (ob_start, ob_get_contents, ob_end_flush, ob_start callbacks) |
| 64 | +- Real file-backed PHP sessions |
| 65 | +- 99.7% PHP standard library coverage (2225/2231 functions) across array, string, file, math, and more |
| 66 | + |
| 67 | +**Extensions (Phase 8)** |
| 68 | + |
| 69 | +- PCRE extension: preg_match, preg_match_all, preg_replace, preg_split with full regex support |
| 70 | +- JSON extension: json_encode, json_decode |
| 71 | +- mbstring extension for multibyte string operations |
| 72 | +- DateTime and DateTimeImmutable classes |
| 73 | +- SPL: iterator classes (ArrayIterator, DirectoryIterator, etc.) and data structures (SplStack, SplQueue, SplPriorityQueue, SplFixedArray) |
| 74 | +- bcmath extension for arbitrary precision arithmetic |
| 75 | +- filter extension (filter_var, filter_input) |
| 76 | +- calendar extension |
| 77 | +- gd extension: pure Rust image creation and manipulation (imagecreatetruecolor, imagecreate, imagesetpixel, imageline, Bresenham-style drawing) |
| 78 | +- intl extension: NumberFormatter, Collator, DateFormatter, Normalizer, Transliterator |
| 79 | +- PDO with PostgreSQL and MySQL drivers, full SQLite3 class support |
| 80 | +- cURL extension with real HTTP networking via ureq, CURLOPT/CURLINFO/CURLE constants |
| 81 | +- openssl extension with real digest and password hashing (bcrypt, PBKDF2) |
| 82 | +- sodium extension with real cryptographic operations |
| 83 | +- random extension |
| 84 | +- hash extension (SHA384/512, HMAC) |
| 85 | +- zlib/flate2 compression |
| 86 | +- pack/unpack for binary data serialization |
| 87 | +- 26 stub extensions wired to real implementations |
| 88 | + |
| 89 | +**SAPI Layer (Phase 10)** |
| 90 | + |
| 91 | +- CLI SAPI as the main binary |
| 92 | +- FPM SAPI with: |
| 93 | + - Full FastCGI request/response cycle with superglobal injection ($_SERVER, $_GET, $_POST, $_COOKIE, $_REQUEST, $_ENV, $_FILES) |
| 94 | + - Pool modes: static, dynamic, and ondemand with configurable worker scaling |
| 95 | + - Thread-based worker pool with mpsc channel dispatch and graceful shutdown |
| 96 | + - Status page (pm.status_path) in plain text and JSON formats, plus ping page |
| 97 | + - Slow log with request timing and configurable threshold |
| 98 | + - php-fpm.conf INI-style parser with full directive support |
| 99 | +- Built-in web server (-S) with: |
| 100 | + - Router script support (returns false to fall through to static files) |
| 101 | + - Concurrent request handling via thread pool (default 4 workers) |
| 102 | + - Access logging with ISO 8601 timestamps and response timing |
| 103 | +- Embeddable library SAPI |
| 104 | +- WebAssembly target for running PHP in the browser |
| 105 | +- Docker support with PostgreSQL and MySQL |
| 106 | + |
| 107 | +**Tooling** |
| 108 | + |
| 109 | +- Composer support: dependency resolution, create-project, run-script |
| 110 | +- Laravel framework compatibility |
| 111 | +- CI via GitHub Actions |
| 112 | +- Criterion benchmarks for echo loops, array operations, function calls, object creation, string concatenation |
| 113 | + |
| 114 | +### Changed |
| 115 | + |
| 116 | +**Runtime and VM Structure (Phases 9, 11, 12)** |
| 117 | + |
| 118 | +- INI system, stream layer, and session handling integrated into runtime crate |
| 119 | +- PHPT test runner infrastructure hardened for compatibility testing |
| 120 | +- VM refactored: call_builtin match arms extracted into builtins/ submodules |
| 121 | +- Parent constructor call tracking ($this before parent::__construct) with Frame.parent_ctor_called flag |
| 122 | + |
| 123 | +### Performance |
| 124 | + |
| 125 | +- Hot loop optimization: error conversion extracted to #[cold] path, dispatch_op remains #[inline] for jump table optimization |
| 126 | +- Arena allocator for request-scoped memory with 256KB bump-pointer chunks, integrated into VM and reset at request start |
| 127 | +- Packed array optimization: O(1) indexed access for sequential 0..n keys, hash indexes built lazily for arrays >16 entries |
| 128 | +- Copy-on-write for strings and arrays: clone is O(1) Rc bump, deep copy deferred to first mutation via Rc::make_mut |
| 129 | +- StringPool with FNV-1a hashing for Rc<str> interning, integrated into VM and reset per request |
| 130 | +- Opcode cache: file-to-compiled-oparray cache with mtime-based invalidation, avoiding recompilation of unchanged files |
| 131 | +- Benchmark suite comparing against PHP-src for echo loops (1M iterations), array operations (sort/map/filter), function call overhead, object creation, and string concatenation |
0 commit comments