Join GitHub today

phpsh is a read-eval-print-loop for php that features readline history, tab completion, and quick access to documentation. It was developed at Facebook and ironically, is written mostly in python. It is open source and released under a modified BSD license.
http://www.phpsh.org/

Autoloading

Individual Configuration

For individual configuration, also see rc.example.php in the php distribution.

Hacking on phpsh

For faster iteration, after installing once, you can run phpsh from src/ directly without reinstalling.

cd ~/www

~/projects/phpsh/src/phpsh

Todo (after phpsh 1.2)

Simple phpsh breakpoints that you can insert into your php code.

jlindamood has suggested adding
a very basic debugging facility in which phpsh.php would define some
function called like phpsh_breakpoint() which you would be able to put
in your code that would cause the php> to re-happen at that breakpoint
so that you can investigate whatever state until you issue like a
phpsh_resume() (or whatever it would be called).

My suspicion is that that can be done pretty easily be having a new
message type from phpsh.php to phpsh.py. (Currently there is only the
'ready' message when phpsh.php is ready to receive a new line of codes
from phpsh.py.)

Magic fatal undoing?

brent suggested adding
some kind of katamari-esque memory snapshotting, so that on fatals like
calling a nonexistent function (which are not catchable in php-land,
sadly) can be magically recovered from. I think dweatherford or larry
would be good to ask about this kind of black magic.