1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/spl/tests/filesystemiterator_leak.phpt
Nikita Popov 44a80b64b9 Fix leak when breaking out of FilesystemIterator
We need to always destroy current, not just when iter.data is not
set.

Take this opportunity to clean up the iterator destructor code a
bit, to remove redundant checks and incorrect comments.
2021-02-15 10:37:59 +01:00

13 lines
199 B
PHP

--TEST--
Don't leak when breaking from FilesystemIterator
--FILE--
<?php
$iterator = new FilesystemIterator(__DIR__);
foreach ($iterator as $value) {
break;
}
?>
===DONE===
--EXPECT--
===DONE===