After working with Python for a while and enjoying the pleasure of having a shell where you can test your code before you actually programm it I came back to PHP and missed the shell big time. Especially when you don’t exactly know how to use special objects or functions. Now the pain of not having such a shell is over, Jan wrote the real shell for PHP. Thanks a lot. This will make testing and just playing with PHP so much easier. It provides of course auto loading of classes.
Download the actual PHP_Shell class here, and rename the file to “.php”. Download the php-shell script, that you want to start later, from the command line here, rename it to “*.php” too.
To make it callable from the command line using “php-shell” you might want remove the “.php” from the later file too and put either both in one directory that is globally reachable (that is in your PATH). The other opportunity, when you don’t want the PHP_Shell file in you bin-directory, would be to put the PHP_Shell class in the include_path, but then you have to adjust the php-shell script to not include the PHP_Shell from “./PHP_Shell”, but as “PHP_Shell”.
Have fun …