Skip to content

Conversation

@adamziel
Copy link
Collaborator

@adamziel adamziel commented Sep 3, 2025

Motivation for the change, related issues

This PR:

  1. Exposes the php.cli() method for in-browser PHP.wasm consumers
  2. Starts using it in the Playground website by swapping the custom spawn handler for the universal sandboxedSpawnHandlerFactory() that calls php.cli() and is consistent across all Playground runtimes.

For context on what makes this possible, see #2589 and #2559.

Testing Instructions (or ideally a Blueprint)

CI

This PR ships the web wasm binaries with the `run_cli` C function that
enables calling php.cli(). Intertwining the CLI SAPI usage with the web
SAPI usage was impractical before #2559, but now we can easily call
`await php.cli(); await php.run()` on the same PHP instance.

Note this PR does not expose the `.cli()` method to the public yet. It
only ships the updated WASM binaries to unlock that.

 ## Testing instructions

 CI
@adamziel adamziel requested a review from a team September 3, 2025 13:42
Base automatically changed from expose-cli-sapi-on-the-web to trunk September 3, 2025 14:24
@adamziel adamziel changed the title [PHP] Include CLI SAPI in the web PHP.wasm build [PHP] Expose php.cli() on the web Sep 3, 2025
@adamziel adamziel merged commit 41607f8 into trunk Sep 3, 2025
51 of 52 checks passed
@adamziel adamziel deleted the use-cli-method-on-the-web branch September 3, 2025 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants