[php-src] Issue #24264: Unwind/GracefulExit discarded in spl_iterators.c

From: Date: Sun, 11 Oct 2026 16:23:24 +0000
Subject: [php-src] Issue #24264: Unwind/GracefulExit discarded in spl_iterators.c
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-252975@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/24264 Author: iluuu1994 ### Description There's a handful of calls to zend_clear_exception() in ext/spl/spl_iterators.c that do not check whether the exception may be discarded. ```php <?php class ReproIterator extends RecursiveArrayIterator { public function hasChildren(): bool { exit(1); } } $it = new RecursiveIteratorIterator( new ReproIterator([1]), RecursiveIteratorIterator::LEAVES_ONLY, RecursiveIteratorIterator::CATCH_GET_CHILD, ); foreach ($it as $_) {} echo "Not reached\n"; ``` Resulted in this output: ``` Not reached ``` But I expected this output instead: ``` ``` ### PHP Version ```plain 8.2+ ``` ### Operating System _No response_

« previous php.bugs (#252975) next »