Question: I have tried to execute simple php code in the php interpreter.
When I executed the command `php -a` I getting the message

> 
> Interactive mode enabled
> 
> 
> 

Without any place for php input.
But I can execute a php code through the command `php -r`.
for example:

`php -r "echo 'Hello stackoverflow!';"`

> 
> Hello stackoverflow!
> 
> 
>

Answer: 
If you're using Mac, then install Homebrew (<http://brew.sh>) then type:
brew install phpsh

And then you can run phpsh to get an interactive shell.
This is what you should see:

```
# php -a
Interactive shell

php > echo 1+1;
2
php > echo PHP_VERSION;
5.3.2-1ubuntu4.14
php > exit
#

```