Sometimes we need to check the result of small snippet of code. We can check it easily from command line. I prefer to use the following 2 options:

PsySH: I think its the best REPL for PHP. It has tab completion, documentation and lot of other features. In its site, it says about it: A runtime developer console, interactive debugger and REPL for PHP.

PHP Interactive mode: PHP has an interactive mode, which can be opened running by command #php -a. Command line will show: php > . Then you can run php statements from there