phpsh -- An interactive shell for php
by Charlie Cheever and Dan Corson

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 listed on this thread of the BBoard.

Download: phpsh-latest.tgz
or using darcs:
darcs get --partial 'http://www.phpsh.org/src/phpsh'

BBoard | Blog | Readme | License | Contact
[rollo]:~/src/phpsh-0.86b$./phpsh example.php 
phpsh (c)2006 by Charlie Cheever and Dan Corson and Facebook, Inc.
type 'h' or 'help' to see instructions & features
Commandline: php -q ./phpsh.php example.php
<php> = 3 + 3
6
php> = $_
6
php> = $_+ $_
12
php> $x = $_
php> print $x
12
php> $y = $x * $x
php> print "$y=144"
144=144
php> = starts_with
starts_with               starts_with($s, $prefix)  
php> = starts_with("abc", "a")
1
php> d starts_with
function starts_with($s, $prefix) {   type=None     file=example.php
/home/.dogmatic/ccheever/src/phpsh-0.86b/example.php, lines 2-10:
/**
 * Returns true if the first arg starts with the second arg
 * @param    string    $big_string
 * @param    string    $little_string
 * @return   true or false
 *
 * @author   ccheever
 */

php> = 2 + \
2
4 php> = array(array(1,2,3), array("a" => "b", "c" => "d", "e" => "f"), 'g', 'h') Array ( [0] => Array ( [0] => 1 [1] => 2 [2] => 3 ) [1] => Array ( [a] => b [c] => d [e] => f ) [2] => g [3] => h ) php> q