ID: 31341
Updated by: [EMAIL PROTECTED]
Reported By: nmuhayimana at semanticdesigns dot com
-Status: Open
+Status: Assigned
Bug Type: Strings related
-Operating System: Windows NT
+Operating System: *
-PHP Version: Irrelevant
+PHP Version: 4CVS, 5CVS
-Assigned To:
+Assigned To: andi
New Comment:
Andi, is this _really_ intentional? :)
Previous Comments:
------------------------------------------------------------------------
[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