Help

Welcome to the PHP-WASM Playground!

The PHP-WASM Playground is a simple in-browser editor using the PHP-WASM module. It is not a fully featured IDE.

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.

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 editor on the left and click the Run button to execute it. You will see the result in the output panel on the right.

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 PHP-WASM module and returns the output in the output panel.
Auto Run Toggle
Automatically executes the PHP code when the editor content changes.
PHP Version Dropdown
You can switch the PHP Version 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.
Code Editor