NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist, #93 most downloaded on Packagist
An interactive shell for modern PHP.
Latest stable
v0.12.24
Last release 4 months ago
29 Jun 2026
Ships fairly regularly
a new release about every 4 weeks
Nearly every release is documented
notes for 59 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
13 years old
126 releases · first in 2014
Drag across the ruler to compare, or tap a release to open it.
Avoid deprecated reflection calls on PHP 8.4+
The pure-PHP experimental readline implementation now has its own built-in pager. Long output opens in an alternate-screen pager with keyboard and mouse scrolling, search, wrap-aware layout, and sensible scrollback behavior after exit.
This is specific to PsySH's experimental userland readline, and it's another reason to give it a try:
psysh --experimental-readlineOr enable it in config:
'useExperimentalReadline' => true,The built-in pager is enabled automatically with experimental readline, or explicitly with 'pager' => true.
We'd love your feedback! Try it out and let us know what works, what doesn't, and what still feels weird.
doc understands more PHP manual targets directly, including structured manual page IDs like language.types.array, language type/operator pages, and language constructs like array and list. Addresses #937 (thanks @Tomirad!)
Manual output also got a big upgrade: variadic signatures make more sense; structured text, tables, and code blocks now render properly; PHP snippets get syntax highlighting; and wrapping works better across styled and wide-character output.
history --session to show, save, or replay only commands from the current REPL sessionhistory --clear now rejects filters and range options instead of accepting combinations it ignorestimeit median calculationsudo instantiation for classes without constructorsghYour coding agent can read these notes before it upgrades. Set up the MCP server →
Fix interactive readline bracket matching inside interpolated strings. Fixes #930
ShellOutput write tracking (e.g. print_r on an Exception with zend.exception_ignore_args = Off). Fixes #934--warm-autoload in project trust restrictionsThe old format is available via useDeprecatedMultilineStrings until the next major release.
PsySH has a new config command for inspecting and updating runtime-configurable settings during the current session. You can tweak things like pager, theme, verbosity, useSuggestions, useSyntaxHighlighting, clipboardCommand, and semicolonsSuppressReturn without restarting the shell. Fixes #361
There’s also a new copy command for copying the last result ($_) or any expression to your clipboard. Works with system clipboard commands, or via OSC 52 for SSH and remote terminals.
Configure with clipboardCommand or useOsc52Clipboard in your config.
Optionally suppress return values by ending a statement with ;, similar to MATLAB/Octave behavior. Supports a 'double' mode requiring ;; for suppression (if requireSemicolons is also enabled, both true and 'double' require ;;).
'semicolonsSuppressReturn' => true,
'semicolonsSuppressReturn' => 'double', // Always require ;; to suppressStrings are now valid PHP!
""". The old format is available via useDeprecatedMultilineStrings until the next major release.Providing an exceptionDetails callback via config renders additional context about exceptions (e.g. validation errors) alongside the error message. Fixes #648
A few other improvements:
help layout adapts to terminal width.Legacy readline now shares PsySH’s newer completion engine, which brings much better parity between ext-readline/libedit and experimental interactive readline. Command argument completion, better multiline buffering, and a handful of command-dispatch edge cases now work much more consistently outside experimental readline too.
Commands can now define their own argument completions via CommandArgumentCompletionAware.
New in the experimental interactive readline:
useSyntaxHighlighting if you don't like colors, I guess.psy\info() and --info also report more detail about readline and autocomplete state.
Run psysh with --experimental-readline and try it out. It's getting kind of awesome!
Bare config and copy at the prompt now resolve to PsySH commands before PHP function calls. Prefix ambiguous input with ; to force PHP execution.
use function and use const statements.throw new Exception in PHP 7.4--pager / --no-pager CLI optionspsy\info() / --info output with interactive completionedit command instead of waiting for the editor to closeAdded an experimental interactive readline: a from-scratch pure-PHP readline replacement built specifically for PsySH. Instead of delegating to ext-re
Added an experimental interactive readline: a from-scratch pure-PHP readline replacement built specifically for PsySH. Instead of delegating to ext-readline or ext-libedit, this gives PsySH full control over input, editing, completion, and rendering.
This is opt-in and experimental. Default behavior is completely unchanged. Enable it in your config or from the command line:
'useExperimentalReadline' => true,psysh --experimental-readlineSee the interactive readline wiki page for more!
The new completion engine is syntax-aware, type-aware, and runtime-value-aware. It parses your input, resolves types from live objects in scope, and completes based on what your code actually is, not just string matching on symbol names.
Type $user-> and see that object's actual methods and properties. Chain through $repo->find(1)-> and get completions for the return type. Fuzzy matching means asum finds array_sum and stl finds strtolower. Completions show in a navigable multi-column menu.
Press Enter on an incomplete statement and the input continues on the next line with proper indentation. Closing brackets auto-dedent. Shift+Enter always inserts a newline. No more fighting the shell to write a multi-line closure.
'useSuggestions' => true.ext-readline or ext-libedit required. Works with any terminal.This addresses a bunch of long-standing issues: #234, #254, #309, #346, #506, #561, #668, #732, #769, #869.
We'd love your feedback! Give it a try, and let us know what works and what doesn't. The goal is to make this the default. Help us get it there. 🧪
Fixed several edge cases with the Restricted Mode introduced in v0.12.19 where non-interactive contexts (piped input, execute() calls, Composer proxy
Fixed several edge cases with the Restricted Mode introduced in v0.12.19 where non-interactive contexts (piped input, execute() calls, Composer proxy scripts) could incorrectly trigger trust prompts or restrict trusted functionality.
Fixes #913
Decoupled commands from ShellOutput via a new ShellOutputAdapter, so commands degrade gracefully when used in non-interactive contexts rather than failing on missing shell features.
bin/ to scripts/Fixed a CWD configuration poisoning vulnerability ( CVE-2026-25129 ) where a malicious .psysh.php file in an attacker-writable directory could execute…
Fixed a CWD configuration poisoning vulnerability (CVE-2026-25129) where a malicious .psysh.php file in an attacker-writable directory could execute arbitrary code when a victim runs PsySH from that directory. This affects all versions prior to v0.12.19 and v0.11.23, including downstream consumers like Laravel Tinker, when invoked from an attacker-writable CWD.
Fixed in v0.12.19 and v0.11.23. Upgrade ASAP.
PsySH now requires explicit trust before loading project-local config (.psysh.php), local PsySH binaries, or Composer autoloads from untrusted projects. Trust decisions are persisted per-project in trusted_projects.json.
Configure with trustProject:
'trustProject' => 'prompt', // default — ask interactively
'trustProject' => 'always', // trust all projects
'trustProject' => 'never', // always run restrictedOr use --trust-project / --no-trust-project CLI flags, or the PSYSH_TRUST_PROJECT env var.
Non-interactive sessions automatically skip untrusted features with a warning.
Tab completion, ls, doc, and show commands now recognize @method and @property docblock tags. Magic members display in magenta so you can tell them apart from real methods and properties.
Inheritance works as expected — magic members from parent classes, interfaces, and traits are included, with child declarations taking precedence.
Also fixes parsing of generic types (e.g., array<int, string>) in docblock tags, which previously broke on whitespace inside angle brackets.
See #905
--cwd to actually change the working directory. Previously it only affected discovery for autoload/config, so relative paths and other directory-dependent behavior didn’t work as expected inside the shell.Fix exit() not working when uopz extension is loaded
exit() not working when uopz extension is loadedCtrl-C might be incorrectly handled after exiting)Install the uopz extension (5.0+) and PsySH will automatically reload modified files during your session. Edit code, switch back to PsySH, and your ch
Install the uopz extension (5.0+) and PsySH will automatically reload modified files during your session. Edit code, switch back to PsySH, and your changes are live—no restart needed!
PsySH skips "risky" reloads by default (conditional definitions, static variables). Use the new yolo command to bypass safety checks:
>>> my_helper()
Warning: Skipped conditional: if (...) { function my_helper() ... }
>>> yolo !!
=> "result"
See the documentation for more details.
Ctrl-C — plays nicer with Laravel + PHP 8.5A quick release adding support for Symfony Console v7.4+ and v8.x.
A quick release adding support for Symfony Console v7.4+ and v8.x.
Don't call deprecated curl_close() on PHP >= 8.0.0 (thanks @mpesari!)
The abbreviated return value output introduced in v0.12.13 has been reverted. This feature attempted to show shorter output for statements that looked like they were trying to take an action (like assignments and method calls with side effects) while preserving full output for inspection-like statements. Unfortunately, this version of the feature just ... wasn't it.
Thanks to everyone who provided feedback. If you've got thoughts on approaches that could make this better, please share them in #512!
You can now update the PHP manual directly from inside the shell! Run doc --update-manual to fetch the latest manual version.
--info and \Psy\info()--update-manual--update-manual with an existing sqlite manualhistory command filtering and --head/--tail interaction to apply filters firstdoc foo when help foo doesn't match a known commandcurl_close() on PHP >= 8.0.0 (thanks @mpesari!)Log user input, command invocations, and executed code to a PSR-3 logger or callback.
Log user input, command invocations, and executed code to a PSR-3 logger or callback.
// Simple callback
$config->setLogging(function ($kind, $data) {
file_put_contents('/tmp/psysh.log', "[$kind] $data\n", FILE_APPEND);
});
// PSR-3 logger with granular control
$config->setLogging([
'logger' => $psrLogger,
'level' => [
'input' => 'info',
'command' => false, // disable
'execute' => 'debug',
],
]);
This has been one of our longest-requested features (🙈) and it fixes #821, #651, and #565.
This release adds a new PHP-based manual data format (v3), replacing the previously used sqlite db. The new format:
The phar builds now bundle the PHP manual, so these changes work out of the box. There are also automatic update notifications, an an --update-manual command to keep docs current.
If you've already got a manual file installed, remove it then run psysh --update-manual (or psysh --update-manual=LANG) after upgrading!
Fixes #595 and #406.
--help output... pushing the limits of what we can plausibly put in a point release.
... pushing the limits of what we can plausibly put in a point release.
Added opt-in autoload warming to improve tab completion and command support. When enabled, PsySH pre-loads classes at startup, making them available to ls, doc, show, and tab completion.
// Enable with defaults (project classes only)
'warmAutoload' => true,
// Advanced configuration
'warmAutoload' => [
'includeTests' => true,
'excludeNamespaces' => ['App\Tests\'],
'includeVendorNamespaces' => ['Symfony\', 'Doctrine\'],
],
Custom warmers can be implemented via AutoloadWarmerInterface. Fixes #650
Auto-adds use statements when you reference a class by its short name (and there's exactly one match in configured namespaces).
'implicitUse' => [
'includeNamespaces' => ['App\'],
'excludeNamespaces' => ['App\Legacy\'],
],
Works great with autoload warming to make class references feel natural.
doc, show, and ls commands now resolve class names using the current namespace and use statements, just like code execution does.
Hitting ctrl-c during long-running code now interrupts execution and returns to the prompt instead of exiting the shell entirely. Works with or without process forking (requires pcntl and posix support). Fixes #154
PsySH now properly handles exit status codes! Use exit(42) for non-zero status codes or exit('message') to print before exiting. Also exits with non-zero status on unrecoverable errors.
Class names, functions, interfaces, constants, and more in ls, doc, and show commands are now clickable links to php.net (requires Symfony 4.3+, PsySH manual installed, and OSC 8 compatible terminal).
--info CLI option--warm-autoload CLI optionClassNamesMatcher tab completionFix ob_start deprecation in PHP 8.5 (thanks @Ayesh!)
Fixing unintentional PHP support version regression due to editor autoformatting :(
Includes the following from v0.12.11:
Fix ob_start deprecation in PHP 8.5 (thanks @Ayesh!)
Remove deprecated setAccessible() calls in reflection (Thanks @W0rma!)
-> (Thanks @igorsantos07!)Prevent deprecation notice when parsing some anonymous classes.
Improve editor command when using default system runtime dir.
Improve editor command when using default system runtime dir.
Resolve type error with the transient readline implementation (Thanks @Fludem!)
Resolve type error with the transient readline implementation (Thanks @Fludem!)
Tighten up a bunch of internal types and defaults.
Tighten up a bunch of internal types and defaults.
This should have absolutely no impact on your day to day life, but it makes things nicer for me :)
Deal with PHP 8.4 E_STRICT deprecation (Thanks @Ayesh!)
New:
--help output for some command input exceptions (for example, if you're missing an argument, instead of just complaining, show the command usage)readline_info() to tab completion matchers' getMatches methods, allowing more complex matching logic (Thanks @tareqas!)Improved:
E_STRICT deprecation (Thanks @Ayesh!)less is not a symlink, and where PHP error suppression is ignored ... or over-eargly turned into exceptions (Thanks @piurafunk!)Improve support for named args (Thanks @HypeMC!)
Fix non-namespaced class support in doc, show, and ls commands.
Fix broken output paging in Alpine-flavored Docker containers (Thanks @iwex!)
Fix deprecated getVersion call (Thanks @Firehed!)
getVersion call (Thanks @Firehed!)Add support for Symfony 7 types, future-proof future Symfony deprecations.
It's that time of year. Let's ship a major version of PsySH!
New:
And improved:
PsySH v0.12.0 drops support for PHP versions older than 7.4.
Upgrade already 🙂
Fixed CWD configuration poisoning vulnerability ( CVE-2026-25129 ). Backported Restricted Mode from v0.12 . PsySH now requires explicit trust before l…
.psysh.php), local PsySH binaries, or Composer autoloads from untrusted projects. Configure with trustProject config option, --trust-project / --no-trust-project CLI flags, or PSYSH_TRUST_PROJECT env var.Fix Sudo static property manipulation in PHP 8.3.
Remove very deprecated Symfony TableHelper fallback (it's been unsupported by our oldest supported Console version for years).
Made a bunch of behind the scenes fixes, that you probably won't even notice. Specifically:
Fix undefined array key (when argv doesn't exist) in userland readline implementation (Thanks @BafS!)
Add strictTypes config option to enforce strict types by default.
New:
strictTypes config option to enforce strict types by default.Fix environment variable lookup when running from the cli-server SAPI (Thanks @supriyo-biswas!)
cli-server SAPI (Thanks @supriyo-biswas!)Use high resolution timing for timeit command.
timeit command.Fix a few edge cases around array assignment.
Bypass visibility restrictions when using reflecting commands (dump, doc, show, list).
Replace undefined DS constant (Thanks @dereckson!)
Setting prompt by itself is deprecated, and has been replaced by Themes. Check them out!
prompt configuration regression.Setting prompt by itself is deprecated, and has been replaced by Themes. Check them out!
Note that specifying a prompt without setting a theme configuration will implicitly use the classic theme.
Fix an input rendering bug in Userland readline implementation.
Fix a type error when calling Docblock::tag with a non-existant tag (Thanks @ExeQue!)
Fix deprecation notices for future Symfony releases (Thanks @Nek-!)
PsySH v0.11.9 includes a lighter, more refined visual style thanks to @nunomaduro and Laravel Tinker! It also introduces a --compact command-line flag
PsySH v0.11.9 includes a lighter, more refined visual style thanks to @nunomaduro and Laravel Tinker! It also introduces a --compact command-line flag, and support for output themes. Check out the wiki for more information.
And if you're ever nostalgic for the old style, add 'theme' => 'classic' to your PsySH config 🙂
PsySH release builds also now feature a self-updater, thanks to @gefd! For future releases, you can run psysh --self-update and it'll pull down the latest build and update in place.
New:
--compact output.--self-update option to release builds (Thanks @gefd!)sudo.Improved:
less pager without spawning a shell (Thanks @wdoekes!)psysh.org/psysh download URL to the "new version available" message (Thanks @gefd!)Fix error starting PsySH on systems with no Readline (Thanks @daniser!)
Fix return type warning on tab completion (Thanks @zonuexe!)
Allow disabling paging entirely by setting 'pager' => false via PsySH config.
New:
'pager' => false via PsySH config.Improved:
TERM=dumb (Thanks @zonuexe!)Ensure that pre-built phars exclude dependencies with known vulnerabilities
Fix missing import in userland readline implementation (Thanks @zonuexe!)
Remove deprecated hoa/console support.
'pager' => 'less -R -S -F -X' to your PsySH config! (Thanks @ooglek!)👆👆 Note that if you've previously used a "compat" build, you don't need to anymore!
Fix deprecation notice when running psy\info() in PHP 8.x (Thanks @virtual-designer!)
psy\info() in PHP 8.x (Thanks @virtual-designer!)@ error suppression operator is present.Fix nullable types in the history command (Thanks @tgooren!)
allow-plugins configuration for Composer 2.2 (Thanks @villfa!)Drop support for PHP 5.x and HHVM.
Kinda big:
All the small things:
supportsBracketedPaste to the Readline interface.@dev and lowest-version dependency testing to CI.In case you missed it above, PsySH v0.11.0 drops support for PHP 5.x and HHVM.
Please. It's almost 2022. If you're not using PHP 8 already, make that your New Year's resolution.
Improve compatibility with upcoming Composer 2.2 release.
This release is largely to fix broken pre-built Phars. PsySH v0.11.x will remove support for PHP 5.x and HHVM, but I didn't want to leave y'all with b
This release is largely to fix broken pre-built Phars. PsySH v0.11.x will remove support for PHP 5.x and HHVM, but I didn't want to leave y'all with broken binaries on the last version supporting PHP 5.x :)
doc command output with inherited docs.Note: Skipping PsySH v0.10.10 due to release script issues.
Nothing published for this version
Various code style fixes (Thanks @GrahamCampbell!)
integer and float number types (Thanks @1ma!)Note that PsySH v0.11.x will remove support for PHP 5.x and HHVM. That means this is quite likely the last release for either of those.
Add support for accessing private properties and consts from parent classes via sudo.
sudo.psy\info() more resilient when extending Psy\Shell rather than using it directly.$__file and $__dir magic variables after calling show $path.Note that v0.10.8 officially removes support for PHP 5.5 in the pre-built phars. They've been broken in PHP 5.5 since v0.10.0 a year ago, due to an incompatibility in the library we use to isolate code, so this is mostly about messaging that incompatibility.
Users who need to use PsySH under PHP 5.5 can continue to install via Composer, or download pre-built phars from v0.9.x.
Fix non-nullable internal function deprecation notice in PHP 8.1 (Thanks @Ayesh!)
New:
--yolo mode for running PsySH without input validation. Most of the time you don't want this, but now it's there as an escape hatch.Improved:
list would support either class name aliases or setting a current namespace, but not both. why_not_both.gifeval(psy\sh()) calls from non-class contexts in PHP >8.0.Suppress exit message in non-interactive mode.
Better function signature rendering in PHP 8.0.
New:
Improved:
instanceof check in PHP 7.3+HOMEDRIVE is undefined on Windows (Thanks @emargareten!)new, class constant fetch, and static calls with non-existant classes in PHP 7+, rather than preventing them entirely.--debug verbosity.include_once. Prevents issues when multiple interactive sessions happen in the same request (Thanks @Aryess!)Remove unhelpful deprecation warning in throw-up command.
New:
--verbose or higher.--all option to the doc command for showing inherited docs.doc on class methods or properties.Improved:
throw-up command.getenv and putenv calls in favor of direct $_SERVER superglobal access.This one's almost too big for a point release!
This one's almost too big for a point release!
New:
--interactive and --no-interactive, to explicitly enable or disable interactive mode.--verbose, --quiet and -v/-vv/-vvv for output verbosity. This one kind of worked before, but only sometimes, and only kind of :)psysh does!verbosity, equivalent to the -v, -vv, -vvv and --silent command line options.interactiveMode, equivalent to --interactive and --no-interactive command line options.formatterStyles, for overriding command line colors.--raw-output, or STDOUT is redirected.STDERR not STDOUT, which makes it easier to split them off from desired output.ls and elsewhere, the line numbers are the same style and colors as in history, etc.ls command can now list namespaces! This means, for example, that ls --classes Psy will return all known classes inside the Psy namespace. This works for constants, functions, interfaces and traits as well.show command now shows files! Try show __DIR__ . '/vendor/autoload.php'. This is super handy when combined with the $__file magic variable set by ls and doc :)Improved:
show command now includes doc comments for classes, interfaces, traits, functions and methods.whereami command now has a --file option for showing the entire file.proctitle extension.doc command.sudo, parse and throwup commands.Work around bug with code isolation in pre-packaged phars.
(Skipping v0.10.1, which was supposed to fix this but didn't)
One column per quarter.