escaping braces

php.internals

Brian Moon

20 years ago
There are severals bugs about this and I would like some clarification. http://bugs.php.net/bug.php?id=35527 http://bugs.php.net/bug.php?id=37263 Reproduce: --------------- <?php $string="abc"; echo "... {$string} ...\n"; echo "... \{$string} ...\n"; ?> PHP4: ------ ... abc ... ... {abc} ... PHP 5.1.2: ----------- ... abc ... ... \{abc} ... =============== Now, I can see changing it so that {} is not escapable. However, it is being escaped. The {} are not being evaluted with the variable in 5.1.2. However, the \ is being left in the string. IMO, you can't have it both ways. I expect from PHP5: -------------------- ... abc ... ... \abc ... Also, this is not listed in the upgrade notes at all http://www.php.net/README_UPGRADE_51.php. Thanks, Brian Moon dealnews.com