PHP · online compiler

Run PHP online

Run PHP online — PHP 8.4 or 8.x, real Zend engine, browser-hosted, no install.

Available versions
Firecracker microVM live per-test verdicts multi-file compile

PHP still powers WordPress (43% of the web), Laravel, Symfony, and most of the CMS-driven internet. PHP 8 is a serious modern language: types, JIT, enums, readonly, property hooks in 8.4.

ls-judge runs PHP 8.x via the standard CLI inside a Firecracker microVM. Pick PHP 8.4 for the current line, or the generic 8.x for the shipped LTS-adjacent build.

Starter code

What you get in PHP

Clicking "Run now" opens the playground with this exact code and a matching test case pre-loaded — passes on first Run.

php
PHP 8.4
<?php $n = (int)trim(fgets(STDIN)); echo ($n * 2) . "\n";
stdin →21
expected →42
FAQ

Common questions about PHP on ls-judge

Which PHP versions?
PHP 8.4 (current) and a generic PHP 8.x (LTS-adjacent) — both with JIT enabled.
Composer packages?
No network — bring source.
Web server (nginx/apache)?
CLI only — this is a code runner, not a web host.
Free?
Yes.
Further reading
Also try