php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #519 next() returning false on end of array
Submitted: 1998-07-08 06:33 UTC Modified: 1998-07-08 08:25 UTC
From: kk at shonline dot de Assigned:
Status: Closed Package: Performance problem
PHP Version: 3.0 Final Release OS: Solaris 2.5.1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
31 + 24 = ?
Subscribe to this entry?

 
 [1998-07-08 06:33 UTC] kk at shonline dot de
According to the documentation and according to my experiments, next() "returns the array element in the next place that's pointed by the internal array pointer, or false if there are no more elements".

Unfortunately, the array element returned by next() may be false or the empty string. It is undecideable, if this is an  array end or an array element, making next() somewhat useless.

Perhaps a real bottom symbol (like perl's "undef") would be appropriate.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-07-08 08:25 UTC] ssb
If you want to traverse an array like this, use the each()
function.  There is an example in the FAQ.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 13:01:28 2024 UTC