Doc #53519 [Opn->Csd]: a minor error in examples
| From: | dtajchreber@php.net | Date: | Sat, 11 Dec 2010 19:03:24 +0000 |
| Subject: | Doc #53519 [Opn->Csd]: a minor error in examples | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-5652@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=53519&edit=1
ID: 53519
Updated by: dtajchreber@php.net
Reported by: M8R-oq0m8v at mailinator dot com
Summary: a minor error in examples
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
PHP Version: Irrelevant
-Assigned To:
+Assigned To: dtajchreber
Block user comment: N
Private report: N
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2010-12-11 20:02:59] dtajchreber@php.net
Automatic comment from SVN on behalf of dtajchreber
Revision: http://svn.php.net/viewvc/?view=revision&revision=306232
Log: Fixed bug #53519 added explicit notes that certain examples won't
work
------------------------------------------------------------------------
[2010-12-11 11:05:14] M8R-oq0m8v at mailinator dot com
Description:
------------
---
From manual page: http://www.php.net/language.types.string
---
There is probably a documentation error in example #8:
<?php
echo "He drank some juice made of $juice[0]s.".PHP_EOL;
echo "$people->robert greeted the two $people->smiths.";
?>
outputs
He drank some juice made of s.
Robert Paulsen greeted the two .
You should use complex (curly) syntax in such cases, because you really
want to output:
He drank some juice made of apples.
Robert Paulsen greeted the two Smiths.
If the author intended to show that simple syntax doesn't work in such
cases, it would be better to provide comments/text explaining this:
echo "He drank some juice made of $juice[0]s.".PHP_EOL; // Invalid; s is
interpreted as a part of variable name
echo "$people->robert greeted the two $people->smiths."; // Invalid; s
is interpreted as a part of variable name
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=53519&edit=1