phpsh — An interactive shell for php
phpsh is an interactive shell for php that features readline history, tab completion, 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.
If you don’t have –with-readline and –with-libedit compiled into your PHP binary but you do have Python2.4 installed, you may find this useful. If your PHP binary includes the readline module, you may prefer one of the pure PHP alternatives you can find by searching the Internet.
http://www.phpsh.org/