#31341 [Opn->Asn]: escape on curly inconsistent

From: Date: Mon, 21 Feb 2005 19:42:32 +0000
Subject: #31341 [Opn->Asn]: escape on curly inconsistent
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-74369@lists.php.net to get a copy of this message
ID: 31341 Updated by: sniper@php.net 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

« previous php.bugs (#74369) next »