Write, run and debug PHP in notebooks inside Visual Studio Code.
PHP Notebook adds a notebook type for PHP (.phpnb files). Mix Markdown notes and PHP code cells, run each cell on its own, and step through it with a debugger when something doesn't behave.
Features
PHP notebooks: create a .phpnb file or run PHP Notebook: New PHP Notebook from the Command Palette.
Run cells: run a cell with your local PHP. stdout and stderr appear below the cell as the script produces them, and you can interrupt a running cell.
Debug cells: the Debug Cell button next to Run starts the cell under Xdebug and attaches the PHP Debug extension. Breakpoints set in the cell editor work, and you can step, inspect variables and view the call stack.
Markdown cells: document your experiments alongside the code.
New cells start with <?php: empty PHP cells get the opening tag, so syntax highlighting and language tooling work as in a normal PHP file.
Language features: completion, diagnostics and other editor features come from the PHP language extension you already use, such as Phpactor or Intelephense. This extension doesn't provide them.
Diff-friendly file format: notebooks are stored as plain JSON text. Outputs are not saved.
Requirements
PHP installed and available on your PATH, or configured with php-notebook.phpPath.