forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fixed bug #61418 (Segmentation fault when DirectoryIterator's or
FilesystemIterator's iterators are requested more than once without having had its dtor callback called in between).
- Loading branch information
1 parent
d974e44
commit d870a41
Showing
2 changed files
with
55 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--TEST-- | ||
Bug #61418: Segmentation fault using FiltesystemIterator & RegexIterator | ||
--FILE-- | ||
<?php | ||
$fileIterator = new FilesystemIterator(__DIR__, FilesystemIterator::KEY_AS_FILENAME); | ||
$regexpIterator = new RegexIterator($fileIterator, '#.*#'); | ||
foreach ($fileIterator as $key => $file) | ||
{ | ||
} | ||
unset($regexpIterator); | ||
unset($fileIterator); | ||
|
||
$dirIterator = new DirectoryIterator(__DIR__); | ||
$regexpIterator2 = new RegexIterator($dirIterator, '#.*#'); | ||
foreach ($dirIterator as $key => $file) | ||
{ | ||
} | ||
unset($regexpIterator2); | ||
unset($dirIterator); | ||
?> | ||
==DONE== | ||
--EXPECT-- | ||
==DONE== |