|  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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: kk at shonline dot de
New email:
PHP Version: OS:


 [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.


Add a Patch

Pull Requests

Add a Pull Request


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-2021 The PHP Group
All rights reserved.
Last updated: Mon Jun 14 05:01:22 2021 UTC