From: [EMAIL PROTECTED]
Operating system:
PHP version: 4.3.0-pre2
PHP Bug Type: Documentation problem
Bug description: prev(), next(), current(), end() should say 'value' rather than
'element'
In the array documentation for current(), prev(), next(), end(), it should
use the word 'value' wherever it means the value in the key=>value pair,
and not the word element.
I was struggling to understand what the array functions prev() and next()
return, as I rarely use them, since each() normally does what is needed.
I understand well when the array documentation talks about 'key' and
'value', but here was a seemingly new concept to me, 'element'. At one
stage I thought it must return the same as each(), i.e. the $key=>$value
pair, though comparing the datatypes returned disproved this theory.
Finally, I deduced from the documentation for current() which talks about
when the value is 0 or "", that what is returned is what is normally
referred to in the array documentation as 'value'.
It should not require such detective work!!
Maybe an example in, say, prev(), would make it all clear:
$transport = {'foot', 'bike', 'car', 'plane'}
$mode = current($transport); // $mode = 'foot';
$mode = next($transport); // $mode = 'bike';
$mode = next($transport); // $mode = 'car';
$mode = prev($transport); // $mode = 'bike' again
$mode = end($transport); // $mode = 'plane'
--
Edit bug report at http://bugs.php.net/?id=20394&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=20394&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=20394&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=20394&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=20394&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=20394&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=20394&r=support
Expected behavior: http://bugs.php.net/fix.php?id=20394&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=20394&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=20394&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=20394&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=20394&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=20394&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=20394&r=isapi
--
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php