php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #7480 next(), end(), prev(), reset() etc. don't return references
Submitted: 2000-10-26 09:26 UTC Modified: 2002-01-06 12:15 UTC
From: mog at linux dot nu Assigned:
Status: Duplicate Package: Feature/Change Request
PHP Version: 4.0.1pl2 OS: RedHat Linux 7.0
Private report: No CVE-ID: None
 [2000-10-26 09:26 UTC] mog at linux dot nu
next(), end(), prev(), reset() etc. don't return references

meaning this example code won't work as it's thought to do:

<?PHP
$array1 = array('element1','element2');
$array2 = array(&$array1);

next(current($array2)); // here the internal pointer is changed in the copy of array1 that is returned and is in not referenced to to the real $array1 as it should
current(current($array2)); // should return "element2"
?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-06 11:47 UTC] jan@php.net
dupe of 7578. 
 [2002-01-06 12:01 UTC] jan@php.net
dupes are bogus..
 [2002-01-06 12:15 UTC] jan@php.net
actually they are dublicates, silly me.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Oct 12 13:01:27 2024 UTC