How to do multi-line input in phpsh?

Can I something like:

php>multline start; .... $a =<<< EOF .... hello hi how are you this is phpSH .... hello there its test line .... EOF; .... multiline end; 

in phpsh?

+4
source share
2 answers

Take an example if a multi-line operator:

  • Type: if (condition) {
  • Just hit Enter
  • ... and write what you want.
  • } Close the multiline statement. And press Enter to execute it.

You can optionally cancel the recording by pressing ctrl + c.

0
source

Perhaps just like that:

 php> $test = " ... hello hi how are you this is phpSH ... hello there its test line ... " <the_empty_result> php> php> echo $test hello hi how are you this is phpSH hello there its test line php> php> =$test "\nhello hi how are you this is phpSH\nhello there its test line\n" 

or

 php> $test = "hello hi how are you this is phpSH ... hello there its test line" <the_empty_result> php> php> echo $test hello hi how are you this is phpSH hello there its test line php> php> =$test "hello hi how are you this is phpSH\nhello there its test line" 

Of course, press Enter to create the aforementioned multi-line input.

0
source

Source: https://habr.com/ru/post/1441956/


All Articles