For Programmers: Free Programming Magazines  


Home > Archive > PHP Documentation > August 2006 > #38645 [NEW]: Does the documentation recommend brackets or curly braces for character









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author #38645 [NEW]: Does the documentation recommend brackets or curly braces for character
z_rules55 at hotmail dot com

2006-08-29, 6:58 pm

From: z_rules55 at hotmail dot com
Operating system:
PHP version: Irrelevant
PHP Bug Type: Documentation problem
Bug description: Does the documentation recommend brackets or curly braces for character access?

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/langua...pe-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/langua...s.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 bug report at http://bugs.php.net/?id=38645&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=38645&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=38645&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=38645&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=38645&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=38645&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=38645&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=38645&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=38645&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=38645&r=support
Expected behavior: http://bugs.php.net/fix.php?id=38645&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=38645&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=38645&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=38645&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38645&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=38645&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=38645&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=38645&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=38645&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=38645&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=38645&r=mysqlcfg
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com