Online PHP Interpreter
This online PHP interpreter executes your scripts with the PHP 8.4 command-line interpreter. Paste code, press Run, and see what it prints, including warnings and errors with line numbers.
How to run PHP code online
- This page opens with PHP selected, so you can start typing straight away.
- Write your code in the editor, or open files from your computer: single files, or a whole project as a .zip.
- Press Run, or Ctrl+Enter. The output appears in the panel beside the editor, and when the program asks for input you type it there and press Enter.
- Share a copy with a link, or save your files to your computer.
PHP 8.4 on Online IDE
- Scripts run with the PHP command-line interpreter, so echo and print write straight to the output panel.
- Read a line of input with fgets(STDIN) and type it in the output panel while the script runs.
- Add more .php files and load them with require or include.
Example: a PHP program that reads input
<?php
echo "Enter a word: ";
$word = trim(fgets(STDIN));
echo strrev($word) === $word
? "$word is a palindrome\n"
: "$word is not a palindrome\n";
Features of this tool
- Simple and fastA clean, lightweight editor that opens instantly.
- Powered by AceThe Ace code editor, with syntax highlighting, autocompletion and bracket matching.
- Interactive programsType input into the terminal while your program runs.
- Several filesWork in tabs, open files or a .zip from your computer, and save the project back to disk.
- Made for learningHelpful for beginners to learn and practice programs.
- Light and dark themesPlus 39 editor themes, a choice of coding fonts, and Vim, Emacs or VS Code keys.
- Keep your outputCopy or download the program output in one click.
- Share by linkSave your code in the cloud and open it anywhere.
Frequently asked questions
Which PHP version does Online IDE run?
PHP 8.4, using the command-line interpreter on Linux.
Can I test web pages or $_GET and $_POST here?
Scripts run from the command line, not behind a web server, so there is no request data. It is the right place to test functions, classes and algorithms.
How do I read input in a PHP script?
Call fgets(STDIN) where you need a line of input, then type it in the output panel and press Enter.
More PHP tools
Contact us
For any feedback, queries or issues, please feel free to contact us or write to . We value your input and are committed to providing the best possible experience for our users.