PHP (Wasm)
PHP in Browser, powered by WebAssembly (using php-wasm).
php-wasm
runs PHP in the browser using WebAssembly. This matches the behavior of the official PHP interpreter and allows using PHP's standard library. However, it requires relatively large download and has limited capabilities for client-side DOM manipulation.
If you need a lighter-weight interpreter with more capable client-side DOM manipulation in PHP and do not need to use PHP's standard library, you may want to use the PHP interpreter written in JavaScript.
Usage
Standard Library
The PHP standard library is supported.
<?php
phpinfo();
JavaScript Interoperability
JavaScript Interoperability is achieved via the VRZNO php extension.
Example:
Check the starter template for another example.
Language Info
Name
php-wasm
Extension
.wasm.php
Alias
phpwasm
Editor
script
Compiler
Version
php-wasm
v0.0.7, running PHP v8.2.4
Code Formatting
Using prettier and Prettier PHP Plugin.
Example Usage
Starter Template
https://livecodes.io/?template=php-wasm
Links
- PHP
- PHP documentation
- php-wasm
- PHP using Uniter in LiveCodes