Bug #46227 [Opn->Dup]: wrong initial pointer for CachingIterator and RecursiveCachingIterator

From: Date: Mon, 17 Jan 2022 11:29:02 +0000
Subject: Bug #46227 [Opn->Dup]: wrong initial pointer for CachingIterator and RecursiveCachingIterator
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-239061@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=46227&edit=1

 ID:                 46227
 Updated by:         cmb@php.net
 Reported by:        exceptione at hotmail dot com
 Summary:            wrong initial pointer for CachingIterator and
                     RecursiveCachingIterator
-Status:             Open
+Status:             Duplicate
 Type:               Bug
 Package:            SPL related
 Operating System:   *
 PHP Version:        5.2.10
-Assigned To:        
+Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

Closing as duplicate of <https://github.com/php/php-src/issues/7952>.


Previous Comments:
------------------------------------------------------------------------
[2015-09-07 20:18:52] cmb@php.net

Indeed, basically that's the same issue as reported in bug #44063:
the constructor misses to properly initialize the OuterIterator.

------------------------------------------------------------------------
[2008-10-24 09:24:31] jani@php.net

Marcus, deal with this.

------------------------------------------------------------------------
[2008-10-06 10:23:25] exceptione at hotmail dot com

Might be the case indeed. I wanted to add a comment over there, but I am not allowed to. So here:

> How could you say this is not a bug? Please reconsider!
> There is one invariant which says: ?the pointer in all new iterators points at the first
> element of the collection that has to be iterated.?
>
> Hence a new iterator a that wraps another new iterator b points to the first element of b.

I am very happy with and grateful for the SPL contribution to php. I really hope the behaviour from
all iterators from the iterator zoo will be consistent. I think these bugs are certainly no bogus.
It's a contract violation and that's painful to me.

------------------------------------------------------------------------
[2008-10-05 18:02:10] felipe@php.net

That looks like #44063

------------------------------------------------------------------------
[2008-10-04 14:57:34] exceptione at hotmail dot com

Note that one get get the expected behaviour from the implementation in
ext\spl\internal\cachingiterator.inc after correcting the following bugs in that file:

add private $flags as class member
on line 50 change flags into $flags
on line 50 delete CIT_ prefix

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=46227


--
Edit this bug report at https://bugs.php.net/bug.php?id=46227&edit=1


Thread (9 messages)

« previous php.bugs (#239061) next »