Re: Here files and backslashes
| From: | J C Lawrence | Date: | Tue, 04 Jul 2000 22:29:26 +0000 |
| Subject: | Re: Here files and backslashes | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-4827@lists.php.net to get a copy of this message | ||
On Tue, 04 Jul 2000 16:03:12 +0000
Jeff Gannaway <webmaster@cactusgraphics.com> wrote:
> At 11:51 AM 7/4/00 -0700, J C Lawrence wrote:
>> Most interestingly it doesn't generate a warning for every
>> backslash character. In the above example is misses the first
>> several backslashes and generates a warning on only the strings
>> "\|" and "\<nl>" where <nl> is an LF (bottom of the
>> man's shield
>> and end of his sword).
> \ is the escape character for PHP. For example, if someone wanted
> to print:
You are missing a key element of the bug report:
The runtime error is being reported for the $variable
__assignment__ NOT for its later use or display. Specifically:
$var2 = <<< END_VAR
...
END_VAR;
for the case of the dragon drawing is reporting a runtime error.
I'm not manipulating the variable at that time at all, Just using a
here file to assign a value to it.
I don't believe that PHP should be at concerned with character
escapes in here file variable assignments.
> The easiest command to use is addslashes().
Yep, this is what I'd do if the error were occuring during later
variable manipulation (and in fact I do use addslashes() there).
--
"Finally coming home" Home: claw@kanga.nu
J C Lawrence Other: coder@kanga.nu
----------(*) Keys etc: finger claw@kanga.nu
--=| A man is as sane as he is dangerous to his environment |=--