ID:          38645
 Updated by:  [EMAIL PROTECTED]
 Reported By: z_rules55 at hotmail dot com
-Status:      Open
+Status:      Closed
 Bug Type:    Documentation problem
 PHP Version: Irrelevant
-Assigned To: 
+Assigned To: philip
 New Comment:


Using brackets is recommended. The type juggling section was overlooked
because most of that information does not even belong there so it's now
been removed. These changes will show up when the manual is next built,
thank you for the bug report! :)

Diff is as follows:
http://cvs.php.net/viewvc.cgi/phpdoc/en/language/types.xml?r1=1.166&r2=1.167




Previous Comments:
------------------------------------------------------------------------

[2006-08-29 21:48:48] z_rules55 at hotmail dot com

Description:
------------
I see the documentation as inconsistent in its recommendation of how to
access a string offset. PHP used to use brackets for accessing a
character at an offset in a string, then braces, now back to brackets.
http://us2.php.net/manual/en/language.types.type-juggling.php says:
"PHP 4 introduced the new curly bracket syntax to access characters in
string, use this syntax instead of the one [using brackets] presented
above"

But then it links you to the part on string access by character
(http://us2.php.net/manual/en/language.types.string.php#language.types.string.substr),
which states:
"[Characters within strings] may also be accessed using braces like
$str{42} for the same purpose. However, using square array-brackets is
preferred."

Why does that part of the documentation still say to "use this syntax
[with braces] instead of the one [using brackets]"?



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=38645&edit=1

Reply via email to