#44948 [Opn->Csd]: heredoc and nowdoc examples are incorrect
| From: | rquadling@php.net | Date: | Fri, 09 May 2008 11:59:30 +0000 |
| Subject: | #44948 [Opn->Csd]: heredoc and nowdoc examples are incorrect | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-803@lists.php.net to get a copy of this message | ||
ID: 44948
Updated by: rquadling@php.net
Reported By: stepheneliotdewey at gmail dot com
-Status: Open
+Status: Closed
Bug Type: Documentation problem
Operating System: N/A
PHP Version: Irrelevant
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:
------------------------------------------------------------------------
[2008-05-08 17:57:56] stepheneliotdewey at gmail dot com
Description:
------------
The examples given in the manual for heredoc and nowdoc are incorrect.
On this page:
http://www.php.net/manual/en/language.types.string.php
Example 2 says that it will print:
My name is "MyName". I am printing some foo.
Now I am printing some Bar2.
This should print a capital 'A': \x41
When actually it prints:
My name is "MyName". I am printing some Foo. Now, I am printing some
Bar2. This should print a capital 'A': A
(There are 2 differences here: Foo should be capitalized, and \x41
should be printed as A instead.)
Example 3 says that it will print:
My name is "$name". I am printing some $foo->foo.
Now, I am printing some {$foo->bar[1]}.
This should not print a capital 'A': \x41
When actually I'm pretty sure that it should print:
My name is "$name". I am printing some $foo->foo.
Now, I am printing some {$foo->bar[1]}.
This should not print a capital 'A': x41
(I have not tested the problem with Example 3 because I only have PHP
5.1. The only error in Example 3 is that there should not be a slash
before the x, because there is not one in the example. Alternatively,
you could add a slash in the example).
Also, in both cases, you are preserving the line breaks, but you should
clarify that the line breaks would not be displayed in an HTML context.
Reproduce code:
---------------
n/a see above
Expected result:
----------------
n/a see above
Actual result:
--------------
n/a see above
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44948&edit=1