PHPOnline PHP Compiler
main.phpPress Run or Ctrl + Enter.
Run PHP 8 code online — functions, arrays, classes and string tools all work. Free, no server needed — PHP runs on your device.
How it works
Step 1
Write or paste
Type PHP code or paste it in. It is kept on this device for next time.
Step 2
Run
Press Run or Ctrl + Enter. Answers for input go in the Input box.
Step 3
See the output
Output, errors with their line number, and how long it took.
Tips for PHP
- PHP 8.4 runs in your browser. The first run downloads it (about 5 MB).
- You can leave out <?php — it is added for you.
- Use echo or print to show output; each run starts fresh.
Questions
How do I run PHP online?
Write or paste PHP and press Run. Whatever you echo or print appears in Output. You can leave out the opening <?php tag.
Which PHP version is it?
PHP 8.4, running inside your browser.
Can I use a database or send emails?
No. PHP runs in your browser, so it can’t reach databases, mail servers or files on your computer.
Why is the first run slow?
PHP (about 5 MB) is downloaded once and kept by your browser, so later runs start quickly.
Is my code uploaded?
No. It runs in your browser and is saved only on this device.