4

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?

mko
  • 21,334
  • 49
  • 130
  • 191

2 Answers2

0

Let's take an example, if multiline statement:

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

You can further cancel writing by hitting ctrl + c.

0

Maybe just like this:

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 above multiline input.

Apostle
  • 482
  • 2
  • 7
  • 23