When I type run PsySH and then type test
, I don't enter a different mode. I actually get an error that reads:
PHP Warning: Use of undefined constant test - assumed 'test' (this will throw an Error in a future version of PHP) in Psy Shell code on line 1
This might be a version issue.
But...
I think I know the mode you're talking about. You can enter that mode by typing one single quote '
and pressing Enter.
What PsySH is doing is letting you supply input across multiple lines. If, on the next line you just type ';
you should see "\n"
because it captured the Enter that you pressed.
If you want to exit this mode, you can either:
- Close whatever opening statement you made. You can enter this mode by typing "
function {
+ Enter", "for(;;) {
+ Enter", the single-quote, and many other things. You need to type the appropriate closing for the statement you started. For a function, }
. For a string, '
or "
, etc.
- Press ^D (Control+D). This will put you back at the PsySH prompt. This will also work in many regular system shells, because
^D
sends the End-Of-File
character.