Skip to main content

PHP

PHP running client-side in the browser using Uniter.

Uniter is a light-weight PHP-to-JavaScript transpiler and runtime with JavaScript interoperability and client-side DOM manipulation. However, only a small subset of PHP's standard library is supported.

Note

If you need better standard library support, you may want to use 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.

Usage

JavaScript Interoperability

Example:

show code
import { createPlayground } from 'livecodes';

const options = {
"template": "php"
};
createPlayground('#container', options);

Language Info

Name

php

Extension

.php

Editor

script

Compiler

Uniter

Version

Uniter v2.18.0

Code Formatting

Using prettier and Prettier PHP Plugin.

Starter Template

https://livecodes.io/?template=php