|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-12-07 16:34 UTC] yani at iliev dot me
-Summary: Segfaullt when using 2
RecursiveFilterIterator
+Summary: Segfault when using 2
RecursiveFilterIterator
-Operating System: Any
+Operating System: Windows 10 Pro x64
-PHP Version: 7.3.0
+PHP Version: 7.2.6
[2018-12-07 16:34 UTC] yani at iliev dot me
[2018-12-07 16:48 UTC] yani at iliev dot me
-Operating System: Windows 10 Pro x64
+Operating System: Any
-PHP Version: 7.2.6
+PHP Version: 7.3.0
[2018-12-07 16:48 UTC] yani at iliev dot me
[2018-12-08 14:24 UTC] cmb@php.net
-Status: Open
+Status: Verified
-Assigned To:
+Assigned To: dmitry
[2018-12-08 14:24 UTC] cmb@php.net
[2019-01-14 10:21 UTC] dmitry@php.net
[2019-01-14 10:21 UTC] dmitry@php.net
-Status: Verified
+Status: Closed
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 15:00:01 2025 UTC |
Description: ------------ When two RecursiveFilterIterator are added to RecursiveDirectoryIterator it results in a segfault. The same code works in PHP 7.2.x and below Test script: --------------- <?php mkdir("/tmp/dir"); mkdir("/tmp/dir/subdir"); touch("/tmp/dir/file1"); touch("/tmp/dir/subdir/file2"); class Filter1 extends RecursiveFilterIterator { public function accept() { return $this->getInnerIterator()->getSubPathname() != ''; } } class Filter2 extends RecursiveFilterIterator { public function accept() { return $this->getInnerIterator()->getSubPathname() != ' '; } } $iterator = new RecursiveDirectoryIterator( '/tmp', FilesystemIterator::SKIP_DOTS ); $iterator = new Filter1( $iterator ); $iterator = new Filter2( $iterator ); $iterator = new RecursiveIteratorIterator( $iterator, RecursiveIteratorIterator::LEAVES_ONLY, RecursiveIteratorIterator::CATCH_GET_CHILD ); foreach ( $iterator as $item ) { echo $iterator->getSubPathName() . PHP_EOL; } Expected result: ---------------- dir/file1 dir/subdir/file2 Actual result: -------------- dir/file1 Process exited with code 139.