Hi internals, If the readline extension is enabled, PHP provides an interactive shell under -a. If it is not enabled, it falls back to an "interactive mode" (yes, the difference between "interactive shell" and "interactive mode" is important here). The interactive mode is simply an stdin input, which needs to be terminated using Ctrl+D. You can only run one script that way.
I think the current behavior is quite confusing, because it's really not obvious that you ended up in this fallback mode (you need to know the difference between "shell" and "mode" in the output) and most people wouldn't know what to do with it. The latest instance of this is https://bugs.php.net/bug.php?id=81033. I think we would be better off disabling -a completely if readline is not available, and exit with a helpful error message. I've opened https://github.com/php/php-src/pull/6976 to that effect. Does that sound reasonable? Regards, Nikita