- Notifications
You must be signed in to change notification settings - Fork8k
Closed
Labels
Description
Description
Hi,
TheInternalIterator
class (inzend_interfaces.c
) uses an internalrewind_called
flag to ensure that internal iterators are always rewound. This flag is checked by thezend_internal_iterator_ensure_rewound
function, in the following methods:
However, in theInternalIterator::rewind()
method, therewind_called
flag is not properly set when the iterator has a rewind handler. As a result, the internal iterator's rewind handler is always called twice on first iteration.
This is problematic since internal iterators can perform potentially heavy initialization logic in therewind
handler (like performing a query in the case of a database result-set iterator).
PHP Version
PHP 8.3-dev
Operating System
irrelevant