PHPsh Interactive PHP Shell

PHP has its own interactive shell just like Python but in my own opinion, interactive shell of Python is more useful than of PHP. And by the way, Python has IPython, a more advanced interactive shell for python.

Let me give you an example why python shell is more useful than php. Type ‘php -a’ for php interactive shell.

You see it doesn’t return any value. What you have to do to return the value is to add ‘echo’.

Yep, output is kind of messed up. The value 5 takes its place before ‘php >’.

And here’s for python.

It clearly shows what would be the output when you call the actual code without having to use ‘print()’ function.

So I searched for alternative opensource tools that could be used as interactive shell and as useful as python and found PHPsh released by Facebook and developed under python language. Cool huh?

You can download the source code from github or you can use git if you have installed it in your box. Instructions below for git or downloaded from github and installation.

A simple test of phpsh.

Pretty similar with python shell huh except you have to use ‘=’ before your code. You can read more about phpsh from its official page.