Forked from bobthecow/psysh


License: MIT

Language: PHP


Package version Build status Made out of awesome


PsySH is a runtime developer console, interactive debugger and REPL for PHP. Learn more at Check out the Interactive Debugging in PHP talk from OSCON on Presentate.


Download the psysh phar to install:

chmod +x psysh

It's even awesomer if you put it somewhere in your system path (like /usr/local/bin or ~/bin)!

PsySH is available via Composer, so you can use it in your project as well:

composer require psy/psysh:@stable

Or you can use by checking out the the repository directly:

git clone
cd psysh

PsySH configuration

While PsySH strives to detect the right settings automatically, you might want to configure it yourself. Just add a file to ~/.config/psysh/config.php (or C:\Users\{USER}\AppData\Roaming\PsySH on Windows):


return array(
    // In PHP 5.4+, PsySH will default to your `cli.pager` ini setting. If this
    // is not set, it falls back to `less`. It is recommended that you set up
    // `cli.pager` in your `php.ini` with your preferred output pager.
    // If you are running PHP 5.3, or if you want to use a different pager only
    // for Psy shell sessions, you can override it here.
    'pager' => 'more',

    // Sets the maximum number of entries the history can contain.
    // If set to zero, the history size is unlimited.
    'historySize' => 0,

    // If set to true, the history will not keep duplicate entries.
    // Newest entries override oldest.
    // This is the equivalent of the HISTCONTROL=erasedups setting in bash.
    'eraseDuplicates' => false,

    // By default, PsySH will use a 'forking' execution loop if pcntl is
    // installed. This is by far the best way to use it, but you can override
    // the default by explicitly enabling or disabling this functionality here.
    'usePcntl' => false,

    // PsySH uses readline if you have it installed, because interactive input
    // is pretty awful without it. But you can explicitly disable it if you hate
    // yourself or something.
    'useReadline' => false,

    // PsySH automatically inserts semicolons at the end of input if a statement
    // is missing one. To disable this, set `requireSemicolons` to true.
    'requireSemicolons' => false,

    // "Default includes" will be included once at the beginning of every PsySH
    // session. This is a good place to add autoloaders for your favorite
    // libraries.
    'defaultIncludes' => array(

    // While PsySH ships with a bunch of great commands, it's possible to add
    // your own for even more awesome. Any Psy command added here will be
    // available in your Psy shell sessions.
    'commands' => array(
        // The `parse` command is a command used in the development of PsySH.
        // Given a string of PHP code, it pretty-prints the
        // [PHP Parser]( parse tree. It
        // prolly won't be super useful for most of you, but it's there if you
        // want to play :)
        new \Psy\Command\ParseCommand,

    // PsySH uses symfony/var-dumper's casters for presenting scalars, resources,
    // arrays and objects. You can enable additional casters, or write your own!
    // See
    'casters' => array(
        'MyFooClass' => 'MyFooClassCaster::castMyFooObject',

    // You can disable tab completion if you want to. Not sure why you'd want to.
    'tabCompletion' => false,

    // You can write your own tab completion matchers, too! Here are some that enable
    // tab completion for MongoDB database and collection names:
    'tabCompletionMatchers' => array(
        new \Psy\TabCompletion\Matcher\MongoClientMatcher,
        new \Psy\TabCompletion\Matcher\MongoDatabaseMatcher,

Downloading the manual

The PsySH doc command is great for documenting source code, but you'll need a little something extra for PHP core documentation. Download one of the following PHP Manual files and drop it in ~/.local/share/psysh/ (or C:\Users\{USER}\AppData\Roaming\PsySH on Windows):

As Seen On…

Project Statistics

Sourcerank 4
Repository Size 50.6 MB
Stars 1
Forks 1
Watchers 1
Open issues disabled
Dependencies 7
Tags 29
Last updated
Last pushed

Recent Tags See all

v0.5.2 July 16, 2015
v0.5.1 July 03, 2015
v0.5.0 July 03, 2015
v0.4.4 March 26, 2015
v0.4.3 March 17, 2015
v0.4.2 March 14, 2015
v0.4.1 February 25, 2015
v0.4.0 February 23, 2015
v0.3.5 February 12, 2015
v0.3.4 February 12, 2015
v0.3.3 January 20, 2015
v0.3.2 December 27, 2014
v0.3.1 December 27, 2014
v0.3.0 December 16, 2014
v0.2.1 October 24, 2014

Something wrong with this page? Make a suggestion

Login to resync this repository