#27181 [Opn->Bgs]: extra quote marks in example 2.7 in PHP manual lists
| From: | kennyt@php.net | Date: | Sun, 08 Feb 2004 05:55:20 +0000 |
| Subject: | #27181 [Opn->Bgs]: extra quote marks in example 2.7 in PHP manual lists | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969358817@lists.php.net to get a copy of this message | ||
ID: 27181
Updated by: kennyt@php.net
Reported By: admin at kcfreepress dot com
-Status: Open
+Status: Bogus
Bug Type: Documentation problem
Operating System: n/a
PHP Version: Irrelevant
New Comment:
Thanks for your comments, but this is not the case. :)
In general, you must quote the keys used in array operations. If you
don't, you'll get a lot of notices when using E_ALL reporting mode.
(And you are using E_ALL, aren't you?)
So really, the ["key"] notation is correct. [key] is just a hack, and
shouldn't be used. ['key'], of course, would be best. =)
Previous Comments:
------------------------------------------------------------------------
[2004-02-07 23:18:18] admin at kcfreepress dot com
Description:
------------
Quoted from the PHP Manual (CHM file version, generated: Sun Oct 05
02:13:52 2003)
----------
Example 2-7. Printing data from our form
Hi <?php echo $_POST["name"]; ?>.
You are <?php echo $_POST["age"]; ?> years old.
----------
In order to avoid parse errors, it seems like this should instead
read:
----------
Example 2-7. Printing data from our form
Hi <?php echo $_POST[name]; ?>.
You are <?php echo $_POST[age]; ?> years old.
----------
Thanks!
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=27181&edit=1