- Multi-version build system supporting 5 PHP versions (8.1, 8.2, 8.3, 8.4, 8.5 RC2)
build-multi.sh- New build script for creating all PHP+ast version combinations- PHP version selector dropdown in web UI
- Phan version selector dropdown in web UI (currently only 5.5.1 available)
- php-ast version selector dropdown in web UI (1.1.2, 1.1.3)
- Automatic constraint enforcement: PHP 8.5 requires ast 1.1.3
- UI disables incompatible ast versions based on PHP selection
- Dynamic WebAssembly loading based on selected PHP, Phan, and ast versions
- Version switching without page reload
MULTI_VERSION_README.md- Implementation documentationBUILD_TROUBLESHOOTING.md- Build troubleshooting guideCHANGELOG.md- This fileMAIN_C_PATCHES.md- Documentation of main.c patches for each PHP version
index.html- Added version selector UI elementsstatic/demo.js- Implemented dynamic php.js loading and version switchingstatic/demo.css- Added styling for version selectorsCLAUDE.md- Updated with multi-version build instructions.gitignore- Addedbuilds/andphan-git-*/to ignore list
- Build script output redirection (2025-10-04)
- Fixed function return value contamination by redirecting informational output to stderr
download_phan_release()now correctly returns only the phar filename- All echo statements in build functions use
>&2to avoid polluting return values
- Version-specific main.c files (2025-10-04)
- Created separate main.c patches for each PHP version (8.1, 8.2, 8.3, 8.4, 8.5)
- Build script now uses correct main-8.{VERSION}.c for each PHP version
- Prevents build failures due to PHP API changes between versions
- PHP 8.5 ast extension compatibility (2025-10-04)
- PHP 8.5 requires ast 1.1.3 (removed ZEND_AST_CLONE and ZEND_AST_EXIT nodes)
- Build script now uses ast 1.1.3 for PHP 8.5, ast 1.1.2 for PHP 8.1-8.4
- Fixes compilation errors with ast extension on PHP 8.5
- Phan development versions (v5-dev, v6-dev) are currently disabled
- Issue:
internal/package.phpcreates malformed phars when building from git - Workaround: Use pre-built stable releases only (5.5.1)
- Status: Under investigation
- Issue:
- PHP versions: 8.1.33, 8.2.29, 8.3.26, 8.4.13, 8.5.0RC2
- Phan version: 5.5.1 (stable)
- php-ast versions: 1.1.2, 1.1.3
- Total builds: 9 (PHP 8.1-8.4 with both ast versions + PHP 8.5 with ast 1.1.3 only)
- Estimated build time: 45-135 minutes total
- Disk space required: ~4.5-9GB
builds/
├── php-81/
│ └── phan-5.5.1/
│ ├── ast-1.1.2/
│ │ ├── php.wasm
│ │ ├── php.js
│ │ └── php.data
│ └── ast-1.1.3/
│ ├── php.wasm
│ ├── php.js
│ └── php.data
├── php-82/
│ └── phan-5.5.1/
│ ├── ast-1.1.2/
│ └── ast-1.1.3/
└── php-85/
└── phan-5.5.1/
└── ast-1.1.3/ (only, ast 1.1.2 incompatible)
- User selects PHP, Phan, or ast version from dropdowns
- If PHP 8.5 is selected, JavaScript enforces ast 1.1.3 requirement
- JavaScript calls
reloadPHPModule() - Cleans up current WebAssembly module
- Dynamically loads new
php.jsfrombuilds/php-{VERSION}/phan-{VERSION}/ast-{VERSION}/ - Loads corresponding
php.wasmandphp.data - Initializes new PHP module
- Re-enables UI buttons
For users upgrading from single-version build:
- Legacy
build.shstill works for single PHP 8.4 + Phan 5.5.1 build - New
build-multi.shcreates builds inbuilds/subdirectory - No changes needed to existing deployments
- To use multi-version: rebuild with
build-multi.shand copybuilds/to deployment
- Implementation based on original phan-demo by @TysonAndre
- Multi-version support added 2025-10-04