Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

> **Stable line (2026)** — First maintained **stable** release **[v1.0.0](https://github.com/PurHur/php-compiler/releases/tag/v1.0.0)**; **v1.1.0** prep adds M5 fast-path stability, enum/property-hook parity, `preg_match` JIT, `spl_autoload*`, and php-in-PHP JIT helpers. Demo-ready VM + AOT for a **web-capable PHP subset**, reference examples **000–009**, and an experimental **self-host** path. Not full Zend PHP compatibility — see [what’s missing](https://purhur.github.io/php-compiler/docs/pages/missing-implementation.html).

**Snapshot (Jul 2026, `master` — v1.1.0 prep):** VM + AOT for shipped examples ✅ · examples web smoke ✅ · self-host spine **5905** / **5905** · **852** builtins · M5 fast + strict ✅ · VM probe ~**20ms**
**Snapshot (Jul 2026, `master` — v1.1.0 prep):** VM + AOT for shipped examples ✅ · examples web smoke ✅ · self-host spine **5907** / **5907** · **852** builtins · M5 fast + strict ✅ · VM probe ~**20ms**

---

Expand All @@ -23,7 +23,7 @@
| **AOT (`phpc build`)** | ✅ For curated subset | Standalone binaries for examples **000–009** and small CGI apps; not arbitrary Composer stacks |
| **JIT (`bin/jit.php`)** | 🚧 Partial | LLVM IR for many constructs; **MCJIT execute** still flaky ([#98](https://github.com/PurHur/php-compiler/issues/98)); EH scripts VM-fallback ([#2114](https://github.com/PurHur/php-compiler/issues/2114)) |
| **Language wave 3** | ✅ Closed batch | **12/12** language + **13/13** stdlib tracker items ([#1380](https://github.com/PurHur/php-compiler/issues/1380)); closures, try/catch, generators (VM), `parent::class`, backed enums (VM), intersection AOT checks |
| **Self-host north star** | ✅ ~90% | M5 fast gate green; spine **5905** / **5905**; vendor prelink **3/3** ([#1492](https://github.com/PurHur/php-compiler/issues/1492)) |
| **Self-host north star** | ✅ ~90% | M5 fast gate green; spine **5907** / **5907**; vendor prelink **3/3** ([#1492](https://github.com/PurHur/php-compiler/issues/1492)) |

### What you can rely on today

Expand All @@ -40,7 +40,7 @@ Counts from `php script/bootstrap-spine-count.php` (literal `require_once` in `c
| Milestone | Status | What it means |
|-----------|--------|----------------|
| **M0–M1** | ✅ | `compiler_minimal` + compile-smoke bundles link and run natively |
| **M2** | ✅ **5905** / **5905** | Full Phase A inventory in spine smoke; native link + lint ✅ |
| **M2** | ✅ **5907** / **5907** | Full Phase A inventory in spine smoke; native link + lint ✅ |
| **M3** | ✅ | HelloWorld strict native ✅; inventory argv `bin/compile.php` ✅ |
| **M4** | ✅ | `make bootstrap-loop-probe` full ladder ✅ (gen-1→gen-2→gen-3 + full-revision) |
| **M5** | ✅ | `make north-star5-verify-fast` (daily); `--strict` pre-merge ✅; vendor **3/3** ✅; gen-0 sidecars refreshed |
Expand Down Expand Up @@ -259,7 +259,7 @@ Full matrices (auto-generated): [`docs/capabilities.md`](docs/capabilities.md) (

**Self-host (experimental, not “stable app” scope)**

See [Current implementation status](#current-implementation-status-june-2026) for the full M0–M5 ladder. Summary: M0–M5 bootstrap gates ✅; spine **5905** / **5905**; M3 strict native + inventory argv ✅; M4 full `bootstrap-loop-probe` ✅; M5 **`north-star5-verify-fast`** (daily) + **`--strict`** pre-merge ✅ ([#1492](https://github.com/PurHur/php-compiler/issues/1492), [#8559](https://github.com/PurHur/php-compiler/issues/8559)). Recent: native spine bundle probe, fast VM execute smoke ([#2201](https://github.com/PurHur/php-compiler/issues/2201)), `GeneratorYieldSourceMarker` spine unit ([#10356](https://github.com/PurHur/php-compiler/pull/10356)).
See [Current implementation status](#current-implementation-status-june-2026) for the full M0–M5 ladder. Summary: M0–M5 bootstrap gates ✅; spine **5907** / **5907**; M3 strict native + inventory argv ✅; M4 full `bootstrap-loop-probe` ✅; M5 **`north-star5-verify-fast`** (daily) + **`--strict`** pre-merge ✅ ([#1492](https://github.com/PurHur/php-compiler/issues/1492), [#8559](https://github.com/PurHur/php-compiler/issues/8559)). Recent: native spine bundle probe, fast VM execute smoke ([#2201](https://github.com/PurHur/php-compiler/issues/2201)), `GeneratorYieldSourceMarker` spine unit ([#10356](https://github.com/PurHur/php-compiler/pull/10356)).

**What we do not target in v1.x**

Expand Down
112 changes: 65 additions & 47 deletions docs/bootstrap-inventory.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ Regenerate: `php script/bootstrap-inventory.php`

| Metric | Count |
|--------|------:|
| PHP files on vm.php path | 5905 |
| Phase A inventory files (M2 ratio SSOT) | 5905 |
| PHP files on vm.php path | 5907 |
| Phase A inventory files (M2 ratio SSOT) | 5907 |
| Phase A ratio-deferred paths | 0 |
| Source constructs flagged (blockers) | 0 |
| Source constructs flagged (warnings) | 17958 |
| Source constructs flagged (warnings) | 17966 |

## Compiler CFG gaps (`lib/Compiler.php`)

Expand Down Expand Up @@ -833,7 +833,7 @@ Rank live CFG gaps across inventory files: `php script/bootstrap-inventory-triag
| `ext/intl/LocaleParseLocale.php` | 0 | 4 |
| `ext/intl/LocaleParserJitHelper.php` | 0 | 1 |
| `ext/intl/LocaleSetDefault.php` | 0 | 2 |
| `ext/intl/Module.php` | 0 | 118 |
| `ext/intl/Module.php` | 0 | 120 |
| `ext/intl/NormalizerGetRawDecomposition.php` | 0 | 2 |
| `ext/intl/NormalizerIsNormalized.php` | 0 | 2 |
| `ext/intl/NormalizerNormalize.php` | 0 | 2 |
Expand Down Expand Up @@ -963,6 +963,8 @@ Rank live CFG gaps across inventory files: `php script/bootstrap-inventory-triag
| `ext/intl/resourcebundle_count.php` | 0 | 3 |
| `ext/intl/resourcebundle_create.php` | 0 | 3 |
| `ext/intl/resourcebundle_get.php` | 0 | 3 |
| `ext/intl/resourcebundle_get_error_code.php` | 0 | 3 |
| `ext/intl/resourcebundle_get_error_message.php` | 0 | 3 |
| `ext/intl/resourcebundle_locales.php` | 0 | 5 |
| `ext/intl/transliterator_create.php` | 0 | 3 |
| `ext/intl/transliterator_create_from_rules.php` | 0 | 3 |
Expand Down Expand Up @@ -11600,49 +11602,51 @@ Rank live CFG gaps across inventory files: `php script/bootstrap-inventory-triag
- new resourcebundle_get (line 187)
- new resourcebundle_locales (line 188)
- new resourcebundle_count (line 189)
- new datefmt_create (line 195)
- new datefmt_format (line 196)
- new datefmt_format_object (line 197)
- new datefmt_parse (line 198)
- new datefmt_localtime (line 199)
- new datefmt_get_error_code (line 200)
- new datefmt_get_error_message (line 201)
- new datefmt_get_pattern (line 202)
- new datefmt_set_pattern (line 203)
- new datefmt_get_timezone (line 204)
- new datefmt_set_timezone (line 205)
- new intlcal_create_instance (line 211)
- new intlcal_get_now (line 212)
- new intlcal_from_date_time (line 213)
- new intlcal_get (line 214)
- new intlcal_set (line 215)
- new intlcal_get_type (line 216)
- new intlcal_add (line 217)
- new intlcal_roll (line 218)
- new intlcal_clear (line 219)
- new intlcal_is_set (line 220)
- new intlcal_equals (line 221)
- new intlcal_get_time (line 222)
- new intlcal_set_time (line 223)
- new intlcal_get_time_zone (line 224)
- new intlcal_to_date_time (line 225)
- new intlcal_field_difference (line 226)
- new grapheme_strlen (line 257)
- new grapheme_substr (line 258)
- new grapheme_strpos (line 259)
- new grapheme_str_contains (line 260)
- new grapheme_strstr (line 261)
- new grapheme_stristr (line 262)
- new grapheme_stripos (line 263)
- new grapheme_strrpos (line 264)
- new grapheme_strripos (line 265)
- new grapheme_extract (line 266)
- new grapheme_levenshtein (line 267)
- new grapheme_str_split (line 268)
- new grapheme_strimwidth (line 269)
- new intl_get_error_code (line 270)
- new intl_get_error_message (line 271)
- new intl_is_failure (line 272)
- new resourcebundle_get_error_code (line 190)
- new resourcebundle_get_error_message (line 191)
- new datefmt_create (line 197)
- new datefmt_format (line 198)
- new datefmt_format_object (line 199)
- new datefmt_parse (line 200)
- new datefmt_localtime (line 201)
- new datefmt_get_error_code (line 202)
- new datefmt_get_error_message (line 203)
- new datefmt_get_pattern (line 204)
- new datefmt_set_pattern (line 205)
- new datefmt_get_timezone (line 206)
- new datefmt_set_timezone (line 207)
- new intlcal_create_instance (line 213)
- new intlcal_get_now (line 214)
- new intlcal_from_date_time (line 215)
- new intlcal_get (line 216)
- new intlcal_set (line 217)
- new intlcal_get_type (line 218)
- new intlcal_add (line 219)
- new intlcal_roll (line 220)
- new intlcal_clear (line 221)
- new intlcal_is_set (line 222)
- new intlcal_equals (line 223)
- new intlcal_get_time (line 224)
- new intlcal_set_time (line 225)
- new intlcal_get_time_zone (line 226)
- new intlcal_to_date_time (line 227)
- new intlcal_field_difference (line 228)
- new grapheme_strlen (line 259)
- new grapheme_substr (line 260)
- new grapheme_strpos (line 261)
- new grapheme_str_contains (line 262)
- new grapheme_strstr (line 263)
- new grapheme_stristr (line 264)
- new grapheme_stripos (line 265)
- new grapheme_strrpos (line 266)
- new grapheme_strripos (line 267)
- new grapheme_extract (line 268)
- new grapheme_levenshtein (line 269)
- new grapheme_str_split (line 270)
- new grapheme_strimwidth (line 271)
- new intl_get_error_code (line 272)
- new intl_get_error_message (line 273)
- new intl_is_failure (line 274)
- 4 class method(s)

### `ext/intl/NormalizerGetRawDecomposition.php`
Expand Down Expand Up @@ -13088,6 +13092,20 @@ Rank live CFG gaps across inventory files: `php script/bootstrap-inventory-triag
- new Error (line 68)
- 2 class method(s)

### `ext/intl/resourcebundle_get_error_code.php`

**Warnings** (review for bootstrap subset):
- new ArgumentCountError (line 30)
- new Error (line 53)
- 2 class method(s)

### `ext/intl/resourcebundle_get_error_message.php`

**Warnings** (review for bootstrap subset):
- new ArgumentCountError (line 30)
- new Error (line 53)
- 2 class method(s)

### `ext/intl/resourcebundle_locales.php`

**Warnings** (review for bootstrap subset):
Expand Down
6 changes: 4 additions & 2 deletions docs/bootstrap-profile.json
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,8 @@
"ext/intl/resourcebundle_count.php",
"ext/intl/resourcebundle_create.php",
"ext/intl/resourcebundle_get.php",
"ext/intl/resourcebundle_get_error_code.php",
"ext/intl/resourcebundle_get_error_message.php",
"ext/intl/resourcebundle_locales.php",
"ext/intl/transliterator_create.php",
"ext/intl/transliterator_create_from_rules.php",
Expand Down Expand Up @@ -6139,9 +6141,9 @@
"test/bootstrap-aot/lib_opcode/main.php"
],
"totals": {
"inventory_files": 5905,
"inventory_files": 5907,
"excluded": 0,
"eligible": 5905,
"eligible": 5907,
"aot_lint_targets": 113,
"aot_link_targets": 100,
"aot_link_lib_targets": 1
Expand Down
6 changes: 3 additions & 3 deletions docs/bootstrap-selfhost.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

**Gen-0 without Zend:** `BOOTSTRAP_M5_NO_ZEND=1 make bootstrap-selfhost-link` installs `prelinked/bootstrap-gen0/bin-compile-aot` and links `compiler_minimal` without `php bin/compile.php` ([#3053](https://github.com/PurHur/php-compiler/issues/3053)). **M5 lib spine compile:** `BOOTSTRAP_NO_ZEND_FALLBACK=1 make bootstrap-selfhost-lib-spine-smoke` (default in link script) refuses host `php bin/compile.php` on the spine emit path ([#8716](https://github.com/PurHur/php-compiler/issues/8716)). **Contributor workflow:** [bootstrap-dev-workflow.md](bootstrap-dev-workflow.md) (tiered gen-1+ path, spine checklist, CI).

**Project north star:** The **compiler fully compiles itself** — native AOT from `lib/` (no `vendor/` at cold boot), then compiles PHP and rebuilds the next compiler revision without Zend. **M2 spine:** **5905** / **5905** Phase A inventory (`php script/bootstrap-spine-count.php`; `check-selfhost-spine-coverage-sync.php`). **M5 daily gate:** `make north-star5-verify-fast` (~1–2 min) ✅; **`--strict`** (~1h) pre-merge only. Committed `prelinked/bootstrap-gen0/` sidecars + vendor **3/3** cold boot. **Hot loop:** VM driver execute probe ~**20ms**; full spine relink only with `BOOTSTRAP_VM_DRIVER_EXECUTE_PROBE_FULL_LINK=1` ([#2201](https://github.com/PurHur/php-compiler/issues/2201)). **Living tracker:** [#1492](https://github.com/PurHur/php-compiler/issues/1492) (was [#1056](https://github.com/PurHur/php-compiler/issues/1056)) · **re-root doc:** [self-host-target.md](self-host-target.md) · **generation ladder:** [bootstrap-generations.md](bootstrap-generations.md) · **M5 fast path:** [bootstrap-m5-fast-path.md](bootstrap-m5-fast-path.md) · public status: [development-status § North star](https://purhur.github.io/php-compiler/development-status.html#north-star-self-host). Parent tracking: [#78](https://github.com/PurHur/php-compiler/issues/78) (roadmap), [#212](https://github.com/PurHur/php-compiler/issues/212) (closed umbrella).
**Project north star:** The **compiler fully compiles itself** — native AOT from `lib/` (no `vendor/` at cold boot), then compiles PHP and rebuilds the next compiler revision without Zend. **M2 spine:** **5907** / **5907** Phase A inventory (`php script/bootstrap-spine-count.php`; `check-selfhost-spine-coverage-sync.php`). **M5 daily gate:** `make north-star5-verify-fast` (~1–2 min) ✅; **`--strict`** (~1h) pre-merge only. Committed `prelinked/bootstrap-gen0/` sidecars + vendor **3/3** cold boot. **Hot loop:** VM driver execute probe ~**20ms**; full spine relink only with `BOOTSTRAP_VM_DRIVER_EXECUTE_PROBE_FULL_LINK=1` ([#2201](https://github.com/PurHur/php-compiler/issues/2201)). **Living tracker:** [#1492](https://github.com/PurHur/php-compiler/issues/1492) (was [#1056](https://github.com/PurHur/php-compiler/issues/1056)) · **re-root doc:** [self-host-target.md](self-host-target.md) · **generation ladder:** [bootstrap-generations.md](bootstrap-generations.md) · **M5 fast path:** [bootstrap-m5-fast-path.md](bootstrap-m5-fast-path.md) · public status: [development-status § North star](https://purhur.github.io/php-compiler/development-status.html#north-star-self-host). Parent tracking: [#78](https://github.com/PurHur/php-compiler/issues/78) (roadmap), [#212](https://github.com/PurHur/php-compiler/issues/212) (closed umbrella).

## Current gates

| Gate | Command | Status |
|------|---------|--------|
| Phase A inventory | `make bootstrap-inventory-check` | ✅ vm.php-path inventory; **0** source blockers; M2 ratio SSOT: `Phase A inventory files` row in `docs/bootstrap-inventory.md` (no ratio-deferred paths — [#2543](https://github.com/PurHur/php-compiler/issues/2543)); `lib/JIT/Builtin/StringPregMatch.php` and `lib/AOT/Linker.php` **included** in spine |
| Spine PHPCfg parse | `php script/bootstrap-spine-php-cfg-parse-check.php` (`--minimal` for M0 bundle) | ✅ no unsupported php-cfg expr/stmt on spine ([#2575](https://github.com/PurHur/php-compiler/issues/2575)); `BOOTSTRAP_SPINE_PHPCFG_PARSE_GATE=1` in `ci-fast.sh` |
| Phase B lib AOT lint | `php bin/compile.php -l lib/*.php` (with `script/php-env.sh`) | ✅ **5905/5905** top-level `lib/*.php` units ([#534](https://github.com/PurHur/php-compiler/pull/534)) |
| Phase B lib AOT lint | `php bin/compile.php -l lib/*.php` (with `script/php-env.sh`) | ✅ **5907/5907** top-level `lib/*.php` units ([#534](https://github.com/PurHur/php-compiler/pull/534)) |
| Phase B fixture lint | `php script/bootstrap-aot-lint.php` | ✅ **13** procedural targets under `test/bootstrap-aot/` + `examples/000-HelloWorld` |
| Phase C native run | `make bootstrap-aot-link` or `./script/bootstrap-aot-link.sh` | ✅ **5905/5905** link targets OK |
| Phase C native run | `make bootstrap-aot-link` or `./script/bootstrap-aot-link.sh` | ✅ **5907/5907** link targets OK |
| Phase D `lib/` link | `make bootstrap-aot-link-lib` or `./script/bootstrap-aot-link-lib.sh` | ✅ `test/bootstrap-aot/lib_opcode/main.php` bundles `lib/OpCode.php` ([#540](https://github.com/PurHur/php-compiler/issues/540)) |
| Bundled `lib/Compiler.php` lint | `./script/bootstrap-selfhost-lint.sh` | ✅ `test/selfhost/compiler_minimal/main.php` + literal `require_once` units toward `bin/vm.php` (no `vendor/`) ([#559](https://github.com/PurHur/php-compiler/issues/559)) |
| Compiler compile smoke lint | `php bin/compile.php -l test/selfhost/compiler_compile_smoke/main.php` | ✅ `compiler_minimal` bundle + literal `require_once` of `test/bootstrap-aot/compiler_smoke.php` (named function CFG) |
Expand Down
Loading
Loading