ID: 36064 Updated by: [EMAIL PROTECTED] Reported By: sqchen at citiz dot net -Status: Assigned +Status: Bogus Bug Type: SPL related -Operating System: redhat 7.3 +Operating System: * -PHP Version: 5.1.2 +PHP Version: 5.* Assigned To: helly New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php You don't check valid(). In general no iterator method must be used when valid() returns false. Previous Comments: ------------------------------------------------------------------------ [2006-01-18 09:43:36] [EMAIL PROTECTED] Assigned to the maintainer. ------------------------------------------------------------------------ [2006-01-18 07:11:28] sqchen at citiz dot net Description: ------------ php manual says RecursiveDirectoryIterator::hasChildren() Returns whether current entry is a directory and not '.' or '..' () Reproduce code: --------------- <?php $obj = new RecursiveDirectoryIterator("bbb"); $obj->rewind(); for($i=0;$i<5;$i++){ var_dump($obj->key()); var_dump($obj->hasChildren()); $obj->next(); } ?> directory bbb included: 1.txt ccc p.txt //ccc is a directory Expected result: ---------------- string(9) "bbb/1.txt" bool(false) string(7) "bbb/ccc" bool(true) string(9) "bbb/p.txt" bool(false) string(4) "bbb/" bool(false) string(4) "bbb/" bool(false) Actual result: -------------- string(9) "bbb/1.txt" bool(false) string(7) "bbb/ccc" bool(true) string(9) "bbb/p.txt" bool(false) string(4) "bbb/" bool(true) string(4) "bbb/" bool(true) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36064&edit=1
