PsySH (github.com/bobthecow/psysh (https://github.com/bobthecow/psysh 9,832 ), 0.12.24, composer require --dev psy/psysh) is a REPL that loads your autoloader and adds commands: ls lists members, show prints source, doc reads the manual, wtf traces the last exception. Laravel 2,157 's artisan tinker is PsySH (Laravel). Typed at vendor/bin/psysh:
$catalog = new Acme\Shop\Catalog();
$catalog->add(new Acme\Shop\Product('BK-SQL-02', 'Indexing Deep Dive', 2900));
$cart = new Acme\Shop\Cart($catalog); $cart->add('BK-SQL-02', 2); $cart->totalCents()
ls -al $cart
show Acme\Shop\Cart::add
$cart->add('NOPE'); $cart->totalCents()
wtfOutput
...
Class Properties:
$catalog Acme\Shop\Catalog {#6236}
$lines [ …1]
...
DomainException No NOPE.
...ls -al shows private members too. eval(\Psy\sh()); on any line of a script opens this shell with that line's variables in scope: a breakpoint without an editor.