Developer tools
PHP Playground: Run PHP Code Online
Type PHP and press Run. Real PHP runs in your browser through WebAssembly, so you can test a snippet, try a new PHP feature or check an answer without a server.
- Runs in your browser
- Free, no sign-up
Output
Press Run to see what your code prints.
The script finished without printing anything.
How to use the PHP Playground: Run PHP Code Online
-
1
Write your PHP code, or pick one of the examples: match, enums, readonly classes, generators, dates and more.
-
2
Choose a PHP version (8.2 to 8.5) to see how your code behaves on each.
-
3
Press Run (Ctrl + Enter). The first run downloads PHP once (about 4 MB); after that runs are quick.
-
4
Copy the output, download the file, or use "Copy link to this result" to share your code.
Frequently asked questions
Is my code sent to a server?
Which PHP versions can I use?
Can I run Laravel or Composer packages?
What happens if my code never ends?
Is my code saved?
Embed this tool on your site
Paste this code into your page. It's free, with no sign-up, ads or cookies.
Please keep the "Powered by Dev-Talk" link.