Online PHP Compiler

Write PHP 8.4 and run it in your browser. Nothing is sent to a server. Fatal errors come with a plain explanation.

Ln 1, Col 1

Run PHP online without a server

This PHP editor runs PHP 8.4 compiled to WebAssembly in your browser, so you can test scripts without a web server. The first run downloads the PHP engine (about 12 MB) once.

echo, arrays, classes, closures, sorting, string and math functions work. fgets(STDIN) reads the Input tab. It is a plain PHP engine: there is no database, no web request and no file system.

When PHP stops with "Fatal error", "Parse error" or "Call to undefined function", a card explains the cause and points to the line.

Frequently asked questions

Which PHP version is it?

PHP 8.4 compiled to WebAssembly.

Can I connect to MySQL?

No. The browser sandbox has no database or network access for PHP. Use it to test logic.

Do I need the opening tag?

Start with <?php. If you leave it out, the code is run as PHP anyway.

How do I read input?

Use fgets(STDIN); it reads the next line from the Input tab.

Is my code private?

Yes. It runs fully in your browser.

Looking for another language? Open the full code editor with 100+ languages.