Read Eval Print Loop (REPL)

PHP’s REPL mode, or Read-Eval-Print Loop, is an interactive shell that allows to execute PHP code line by line and see immediate results. It’s useful for testing code snippets, debugging, and experimenting with PHP functions without creating separate files.

This mode is also called the interactive mode. It is started, on command line, by calling PHP with the -a option: >php -a. The mode is ended by calling quit.

$ php -a
Interactive shell

php > echo 5+3;
8
php > quit
$

Documentation

See also Creating a PHP REPL for learning purposes, Boris, A tiny, but robust REPL for PHP. and Say Hello to Boris: A Better REPL for PHP.

Related : Webserver, Server Application Programming Interface (SAPI), Command Line Interface (CLI), Readline

Related packages : psy/psysh, d11wtq/boris