PsySH

Runtime developer console, interactive debugger and REPL for PHP, with configurable themes, history management and system shell integration.

install

PsySH is an interactive PHP console and REPL. Running psysh opens a prompt where you can evaluate expressions, define functions, and inspect results without creating a separate script for each experiment. The manual also covers command history, session variables, shell integration, and configurable themes.

It can be embedded in a PHP program with eval(\Psy\sh()). Execution pauses at that point and opens a shell with access to the surrounding program state. A debugging context can also be passed explicitly to \Psy\debug(), including a bound object for inspecting the current class context.

This is interactive inspection rather than a step-through debugger. The documented embedding workflow supports command-line scripts and PHP's built-in web server; it does not support debugging through Apache, nginx, or PHP-FPM. It suits PHP developers exploring code and investigating application state from the terminal.

Installation

# via Homebrew
brew install psysh
# via Composer (project dependency)
composer require psy/psysh:@stable

Alternatives & related tools

add a badge to your README

Maintain PsySH? Show that it's featured on trmn. The badge links back to this page.

Featured on trmn
Markdown
[![Featured on trmn](https://www.trmn.sh/badge/psysh.svg)](https://www.trmn.sh/tools/psysh?utm_source=badge)
HTML
<a href="https://www.trmn.sh/tools/psysh?utm_source=badge"><img src="https://www.trmn.sh/badge/psysh.svg" alt="Featured on trmn" height="20"></a>