|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-01-18 00:01 UTC] dahlgren dot andreas at gmail dot com
Description:
------------
\{$var} results in wrong output.
Reproduce code:
---------------
<?
$var = "hello";
echo "\{$var}";
?>
Expected result:
----------------
{hello}
Actual result:
--------------
\{hello}
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 16 21:00:02 2025 UTC |
"This is expected behaviour, {} is no longer special, they are being treated like any other character." Ok if the above is true then bothe these statements should display the same thing? echo "{".$var."}"; echo "{$var}"; but the first one is "{hello}" and the otherone is "hello".The {$var} syntax is still available. So yes, { } are in a way still "special". To have '{hello}' printed you now need to use "{\$var}" and not "\{$var}" anymore. Being able to use "\{$var}" to print '{hello}' was an inconsistency that now is fixed. No documentation bug here.