#31341 [Asn]: escape on curly inconsistent
| From: | stas@php.net | Date: | Wed, 18 May 2005 10:33:31 +0000 |
| Subject: | #31341 [Asn]: escape on curly inconsistent | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-79128@lists.php.net to get a copy of this message | ||
ID: 31341
Updated by: stas@php.net
Reported By: nmuhayimana at semanticdesigns dot com
Status: Assigned
Bug Type: Strings related
Operating System: *
PHP Version: 5CVS, 4CVS
Assigned To: andi
New Comment:
I think there's an omission in ST_IN_SCRIPTING state backshlash
handling (around line 1525 of lex file) - unlike ST_DOUBLE_QUOTES
state, it does not convert \{ to {. I think they should be brought
together, though I'm not sure which one should win - should \{ be left
as is or translated to {?
Previous Comments:
------------------------------------------------------------------------
[2005-02-21 20:42:31] sniper@php.net
Andi, is this _really_ intentional? :)
------------------------------------------------------------------------
[2004-12-30 02:57:49] nmuhayimana at semanticdesigns dot com
Description:
------------
Php suppresses the backslash before left curly brace using
"action at distance", violating the "principle of least surprise".
Apparently the backslash is suppressed if there is any non-escaped
dollar sign any where in the string.
Reproduce code:
---------------
<?php
echo ("$ \{ \n");
echo (" \{ $\n");
echo (" \{$ \n");
echo (" $\{ \n");
echo (" \$\{ \n");
echo (" \{\$ \n");
echo ("\$ \{ \n");
echo (" \{ \$\n");
echo ("% \{ \n");
?>
Expected result:
----------------
$ \{
\{ $
{$
$\{
$\{
\{$
$ \{
\{ $
% \{
Actual result:
--------------
$ {
{ $
{$
${
$\{
\{$
$ \{
\{ $
% \{
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=31341&edit=1