PHP Editor
iwantcoding.com ships an in-browser PHP editor that runs real PHP via php-wasm — PHP compiled to WebAssembly. Type code on the left, press Run », see output on the right.
Open the PHP Editor »
Opens in this tab. Use the browser Back button to return.
What you can do
- Run any PHP you write —
echo,print_r,var_dumpall stream into the output pane. - Use the standard library —
json,preg_*,str_*,array_*,DateTime,SPL, and more. - Define classes, interfaces, traits, enums. Modern PHP 8.x syntax is fully supported.
- Pick from ready-made sample programs in the toolbar dropdown.
Things to know
- The script runs as a one-shot CLI — no Apache, no
$_GET/$_POST/$_SESSION. For form examples, simulate the data:$_POST['name'] = 'Ada';. - File I/O writes to an in-browser virtual filesystem.
- No network —
file_get_contents('https://…')can't reach the internet. Use the simulated examples instead. - Heavy extensions (PDO drivers, gd, imagemagick) aren't included.
Sample to try
PHP
<?php
$status = 'paid';
echo match ($status) {
'paid' => 'OK',
'pending' => 'Awaiting',
'refunded' => 'Refund issued',
default => 'Unknown',
};
Keyboard shortcuts
| Shortcut | Does |
|---|---|
| Ctrl+Enter (or Cmd+Enter) | Run the program. |
| Tab | Indent (4 spaces — PSR-12 convention). |
| Clear output | Empties the output panel without restarting PHP. |
Tip: php-wasm is a real PHP interpreter compiled to WebAssembly — anything you'd type in a terminal
php session works here, with the networking caveats noted above.Example
Example
<?php echo 'Welcome to the iwantcoding.com PHP editor — powered by php-wasm.'; echo PHP_EOL, 'Running PHP ', PHP_VERSION;Try it Yourself »
Exercise
WebAssembly PHP runtime used by the editor.
Engine:
Hyphenated 8 chars.
Discussion
Loading…