php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #53614 Strings variable parsing - problematic example among complex syntax examples
Submitted: 2010-12-27 03:20 UTC Modified: 2016-06-14 13:43 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: chealer at gmail dot com Assigned: cmb (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: chealer at gmail dot com
New email:
PHP Version: OS:

 

 [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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-02-10 14:15 UTC] vrana@php.net
-Status: Open +Status: Bogus
 [2011-02-10 14:15 UTC] vrana@php.net
It's already there:

echo "This is {$great}";
echo "This is ${great}";
 [2011-02-10 18:47 UTC] chealer at gmail dot com
Huh, what is already where?
 [2011-02-10 18:58 UTC] chealer at gmail dot com
rquadling: who, me? That page is the one with the problem.
 [2011-02-10 19:26 UTC] rquadling@php.net
-Status: Bogus +Status: Re-Opened
 [2011-02-10 19:26 UTC] rquadling@php.net
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.
 [2015-05-08 17:32 UTC] cmb@php.net
-Status: Re-Opened +Status: Verified -Type: Bug +Type: Documentation Problem
 [2015-05-08 17:32 UTC] cmb@php.net
${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.
 [2016-06-14 13:42 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=339345
Log: Fix #53614: Strings variable parsing - problematic example among complex syntax examples
 [2016-06-14 13:43 UTC] cmb@php.net
-Status: Verified +Status: Closed -Assigned To: +Assigned To: cmb
 [2016-06-14 13:43 UTC] cmb@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.
 [2020-02-07 06:07 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=eeb2bef9bb0d4e8146a454557390e5c075d774c4
Log: Fix #53614: Strings variable parsing - problematic example among complex syntax examples
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 17:01:28 2024 UTC