As recently commented, PHP has been in great need of a decent shell environment for some time now and, as users of Python and, even better, Ruby’s irb will maintain, access to all the language’s constructs and libs at the commandline is a great timesaver and should be a standard feature for all scripting languages.
Luckily for PHPers Jan Kneschke has come to the rescue and implemented PHP Shell in userland PHP, which provides many of the features that come by default in the aforementioned languages’ interactive shells. If your PHP is compiled –with-readline support even better, standard up-arrow command history is available, as is the ability to backspace into the code you have written but not yet executed.
What is newsworthy about PHP Shell is that it has recently was made available as a PEAR lib, so it’s just a matter of
$ pear install PHP_Shell-alpha
and then execute the php-shell.sh script which is discoverable in your PATH if you’re using Linux (or there is a cmd equivalent for Windows users still on the dark side).
Although the docs section of PHP_Shell is still empty at the PEAR site, a README is available with the package with all the basic info you will need, or just type ‘?’ at the command line once interactive script is running.
I personally think this is one of the more exciting PEAR releases to come about in a long time. Not to diminish the importance of the steady and voluminous release of packages enjoyed by the PEAR project (and more so by PHP users) over the last months, but PHP Shell is something I will use on a daily basis as part of earning my living as a programmer, along with phpDocumentor, PEAR::Log and Mail and many of the bread and butter packages required for any decent web app.
At a time where the trend is to move away from PEAR, or to rewrite many of the PEAR libs from scratch instead of improving existing work (ezComponents, Zend Framework), I tip my hat to the hard working PEAR community and wish the project the continued success it deserves, despite current fashion trends.







