Export Zend symbols for PHP side modules#3690
Merged
Merged
Conversation
This was referenced May 27, 2026
adamziel
added a commit
to WordPress/sqlite-database-integration
that referenced
this pull request
May 27, 2026
## What? Adds a browser-runtime compatibility check for the `wp_mysql_parser` WASM side modules and wires it into both WASM workflows: - `wasm-spike.yml` - `publish-wasm-extension-artifact.yml` The check compares each side module's `env` function imports against the matching Playground web PHP.wasm runtime exports. It runs for PHP 8.0 through 8.5 so the published manifest cannot claim browser support for a PHP version that will crash during extension startup. Also updates the native extension README/demo URL to use the live `blueprint.json` location and documents PHP 8.0-8.5 browser-runtime coverage instead of the temporary PHP 8.3 pin. ## Why? The previous Node-based smoke test was insufficient: PHP 8.4 loaded in the Node/CLI runtime but crashed in the browser runtime because the web runtime did not export Zend symbols imported by the extension side module. This PR makes that class of failure visible in CI before publishing a WASM manifest. ## Dependency This depends on WordPress/wordpress-playground#3690 and updated Playground web PHP.wasm artifacts. Current Playground web builds are known to miss required exports for PHP 8.0, 8.1, 8.4, and 8.5; the new CI check is expected to pass once those runtime exports ship. ## Testing - `node --check packages/php-ext-wp-mysql-parser/wasm-spike/check-playground-web-compat.mjs` - `git diff --check` - Verified locally with the Playground checkout: - PHP 8.3 currently passes. - PHP 8.4 currently fails with missing `zend_declare_class_constant_ex` and `zend_register_internal_class_ex`, matching the browser crash root cause. --------- Co-authored-by: Jan Jakeš <jan@jakes.pro> Co-authored-by: Chloe Pomegranate <chloehoughtonjenkins+git@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Francesco Bigiarini <francesco.bigiarini@gmail.com> Co-authored-by: Wojtek Naruniec <wojtek@naruniec.me> Co-authored-by: wpfuse <113634078+wp-fuse@users.noreply.github.com> Co-authored-by: Ashish Kumar <ashfame@users.noreply.github.com> Co-authored-by: Jon Surrell <sirreal@users.noreply.github.com> Co-authored-by: John Blackbourn <john@johnblackbourn.com> Co-authored-by: Jonathan Desrosiers <359867+desrosj@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
adamziel
added a commit
to WordPress/sqlite-database-integration
that referenced
this pull request
May 27, 2026
## What? Updates the GitHub Pages native parser demo to use PHP 8.5 instead of the temporary PHP 8.3 pin: - Playground links now use `php=8.5`. - The Blueprint preferred PHP version is now 8.5. - The page text says the manifest supports PHP 8.0 through 8.5. ## Why? The PHP 8.3 pin was a workaround for missing Zend exports in the Playground browser runtime. Once WordPress/wordpress-playground#3690 and rebuilt web PHP.wasm artifacts ship, the browser runtime should support the published `wp_mysql_parser` side modules across PHP 8.0-8.5. ## Dependency Do not merge/publish this until the Playground web-runtime fix and rebuilt artifacts are live, and #417 passes against them.
adamziel
added a commit
to WordPress/sqlite-database-integration
that referenced
this pull request
May 27, 2026
## What? Adds a browser-runtime compatibility check for the `wp_mysql_parser` WASM side modules and wires it into both WASM workflows: - `wasm-spike.yml` - `publish-wasm-extension-artifact.yml` The check compares each side module's `env` function imports against the matching Playground web PHP.wasm runtime exports. It runs for PHP 8.0 through 8.5 so the published manifest cannot claim browser support for a PHP version that will crash during extension startup. Also updates the native extension README/demo URL to use the live `blueprint.json` location and documents PHP 8.0-8.5 browser-runtime coverage instead of the temporary PHP 8.3 pin. ## Why? The previous Node-based smoke test was insufficient: PHP 8.4 loaded in the Node/CLI runtime but crashed in the browser runtime because the web runtime did not export Zend symbols imported by the extension side module. This PR makes that class of failure visible in CI before publishing a WASM manifest. ## Dependency This depends on WordPress/wordpress-playground#3690 and updated Playground web PHP.wasm artifacts. Current Playground web builds are known to miss required exports for PHP 8.0, 8.1, 8.4, and 8.5; the new CI check is expected to pass once those runtime exports ship. ## Testing - `node --check packages/php-ext-wp-mysql-parser/wasm-spike/check-playground-web-compat.mjs` - `git diff --check` - Verified locally with the Playground checkout: - PHP 8.3 currently passes. - PHP 8.4 currently fails with missing `zend_declare_class_constant_ex` and `zend_register_internal_class_ex`, matching the browser crash root cause. ## Note Replacement for #417, which was accidentally opened and merged against `develop` instead of `trunk`.
bgrgicak
pushed a commit
that referenced
this pull request
May 28, 2026
## What? Exports the Zend symbols needed by PHP 8.x side-module extensions from the Playground JSPI main module: - `_call_user_function_impl` - `zend_declare_class_constant_ex` - `zend_register_internal_class_ex` Also rebuilds the affected web JSPI artifacts: - `packages/php-wasm/web-builds/8-0/jspi` - `packages/php-wasm/web-builds/8-1/jspi` - `packages/php-wasm/web-builds/8-4/jspi` - `packages/php-wasm/web-builds/8-5/jspi` ## Why? The `wp_mysql_parser` extension built by WordPress/sqlite-database-integration loaded in the Node/CLI runtime but crashed the browser runtime for some PHP versions. The browser crash happened before WordPress booted because the side module imported Zend symbols that were not exported by the web PHP.wasm build. Observed compatibility against the previous web builds: - PHP 8.2 and 8.3 already exported all required symbols. - PHP 8.0 and 8.1 missed `zend_declare_class_constant_ex`. - PHP 8.4 missed `zend_declare_class_constant_ex` and `zend_register_internal_class_ex`. - PHP 8.5 missed those two plus `_call_user_function_impl`. The Node builds already exposed these symbols, so this aligns web with Node and allows external PHP extension manifests to support PHP 8.0 through 8.5 consistently. ## Testing - Rebuilt web JSPI PHP artifacts for 8.0, 8.1, 8.4, and 8.5. - Ran `git diff --check`. - Verified the `wp_mysql_parser` side module imports are satisfied by the matching web runtime exports for PHP 8.0 through 8.5 using a local WebAssembly import/export comparison.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Exports the Zend symbols needed by PHP 8.x side-module extensions from the Playground JSPI main module:
_call_user_function_implzend_declare_class_constant_exzend_register_internal_class_exAlso rebuilds the affected web JSPI artifacts:
packages/php-wasm/web-builds/8-0/jspipackages/php-wasm/web-builds/8-1/jspipackages/php-wasm/web-builds/8-4/jspipackages/php-wasm/web-builds/8-5/jspiWhy?
The
wp_mysql_parserextension built by WordPress/sqlite-database-integration loaded in the Node/CLI runtime but crashed the browser runtime for some PHP versions. The browser crash happened before WordPress booted because the side module imported Zend symbols that were not exported by the web PHP.wasm build.Observed compatibility against the previous web builds:
zend_declare_class_constant_ex.zend_declare_class_constant_exandzend_register_internal_class_ex._call_user_function_impl.The Node builds already exposed these symbols, so this aligns web with Node and allows external PHP extension manifests to support PHP 8.0 through 8.5 consistently.
Testing
git diff --check.wp_mysql_parserside module imports are satisfied by the matching web runtime exports for PHP 8.0 through 8.5 using a local WebAssembly import/export comparison.