Help

Welcome to the PHP-WASM Multi-Run Editor!

The PHP-WASM Multi-Run Editor allows you to run the same PHP code against multiple PHP versions simultaneously for comparison.

This execution mode is often called n-version execution. It allows differential testing of PHP code across versions.

The PHP-WASM module is the PHP interpreter compiled to WebAssembly using Emscripten. It allows you to run PHP code directly in the browser.

Who is this for?

This app is for anyone that wants to run PHP snippets or inspect the inner workings of the PHP VM across multiple versions.

It has been designed with the idea of an in-browser testing ground for small snippets against multiple PHP versions in mind.

The inspiration is of course the well-known 3v4l.org playground project, where you can do the same but against hosted PHP versions.

Here everything runs in the browser, and once the web application is loaded, it will even work without internet connection.

Usage

Write your PHP code in the shared editor on the left. Add PHP version panels on the right using the "Add Version" button. Each panel allows you to select a PHP version and run the code against it. Click "Run All" to execute across all versions at once.

Keep in mind to start with the usual PHP opening tag: <?php

For issues related to the PHP-WASM module or this playground, please visit: github.com/jakoch/php-wasm-devbox/issues

Interactions

Run Button
Executes the PHP code using the selected PHP-WASM module for that panel.
Run All Button
Executes the PHP code across all configured PHP versions at once.
Add Version Button
Adds a new PHP version panel for running code against another version.
Remove Button
Removes the PHP version panel.
PHP Version Dropdown
You can switch the PHP Version for each panel using the PHP version selector.
Editor Dropdown
You can switch between CodeMirror and Monaco editors using the editor type selector.
PHP Example Dropdown
You can select a PHP example from the dropdown to load it into the editor.
Load File Button
Loads a PHP file into the editor. The files are loaded from the examples folder.
Save Button
Saves the PHP code to file. The file name format is "index-YYYYMMDD-HHMM.php".
Copy Button
Copies the content of the code editor to the clipboard.
Reset Button
Resets the PHP code editor to a basic hello world example.
Output Mode Toggle
You can toggle the output mode and select between raw text and HTML rendering.

Status Displays

PHP Version Display
Shows the PHP version used for executing your PHP code.
Performance Display
Shows how long it took to run your PHP code.

Keyboard Shortcuts & Accessibility

  • Tab / Shift+Tab: Move focus between all interactive controls and panels
  • Enter / Space: Activate focused button, toggle, or dropdown
  • Ctrl + +: Increase editor font size
  • Ctrl + -: Decrease editor font size
  • Ctrl + S: Save editor content as a PHP file
  • Ctrl + C: Copy editor content to the clipboard
  • Skip Links: Use Tab at the top of the page to jump directly to Editor or Output
  • Screen Reader Support: Output and error panels announce updates automatically; all icons and controls have accessible labels
  • All features are fully usable with keyboard and screen reader
PHP logo

Shared Code Editor

Ln: 1, Col: 1 Size: 0 bytes 14px
 

PHP Function Reference