Re: String BC break \{$a}
| From: | Christian Schneider | Date: | Fri, 23 Mar 2007 09:30:20 +0000 |
| Subject: | Re: String BC break \{$a} | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-28569@lists.php.net to get a copy of this message | ||
Tomas Kuliavas wrote:
It was changed in 5.1.0-5.1.1 versions. According to PHP Manual (http://www.php.net/language.types.string) curly brackets are not escaped with backslash. Escape worked in older PHP versions. It does not work in 5.1.1+. http://bugs.php.net/31341 http://bugs.php.net/35411These two (fixed and closed) bugs diff from mine I think:
31341: $ \{ => $ \{
vs.
35411: \{$string} => {$string}
vs.
my problem with PHP 5.1.5/5.2.1: \${string} => \{abc}
vs.
PHP4: \{$string} => {abc}
So with PHP 5.1.5 and PHP 5.2.1 curly braces *are* escaped (they are still output) but the backslash is output as well. If they would not be escaped at all I would have expected \abc. I still think the PHP4 way has the lowest WTF factor.
Is this behaviour an oversight (and I should open a bug report) or is this intentional? I'm still not sure.
- Chris