|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-12-27 03:20 UTC] chealer at gmail dot com
Description: ------------ Strings variables parsing, documented on http://ca2.php.net/manual/en/language.types.string.php#language.types.string.parsing , has a complex form that puts an expression inside braces. This allows many kinds of expressions, so the page gives several examples, but one isn't an example of that: echo "This is ${great}"; I don't know where that example belongs. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 08:00:01 2025 UTC |
It's already there: echo "This is {$great}"; echo "This is ${great}";Aha. I see what you mean. The documentation says "Since { can not be escaped, this syntax will only be recognised when the $ immediately follows the {." This makes no mention of "{ immediately following the $". In fact, that looks SO wrong that I'm surprised it isn't a parse error. I don't know how to explain the usage.${great} is a variation of the simple syntax ("Enclose the variable name in curly braces to explicitly specify the end of the name."), and so the example should be moved up one section.