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 ena
You are in interactive mode, but without a prompt, since you may not have readline mode available. You just just need to start typing, and your commands will be evaluated after you press enter. It doesn't look like anything is going on, but if you enter, for example:
...you will get output...
If you enter braced blocks, they get evaluated after you press enter following the closing }
Note that you must start with or anything entered won't be evaluated.
On a Red Hat (RHEL5) system running the vendor's security patched PHP 5.3.3, I have encountered an interactive mode which did not echo back following closing braces.
Instead, the output buffer was not flushed until I pressed Ctrld. Effectively, this makes the interactive session one-time-use. Insert all code input, and Ctrld to return all output at once.