mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
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.
13 lines
199 B
PHP
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===
|