#36064 [Opn->Asn]: RecursiveDirectoryIterator::hasChildren 's problem
| From: | sniper@php.net | Date: | Wed, 18 Jan 2006 08:43:37 +0000 |
| Subject: | #36064 [Opn->Asn]: RecursiveDirectoryIterator::hasChildren 's problem | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-92115@lists.php.net to get a copy of this message | ||
ID: 36064
Updated by: sniper@php.net
Reported By: sqchen at citiz dot net
-Status: Open
+Status: Assigned
-Bug Type: Unknown/Other Function
+Bug Type: SPL related
Operating System: redhat 7.3
PHP Version: 5.1.2
-Assigned To:
+Assigned To: helly
New Comment:
Assigned to the maintainer.
Previous Comments:
------------------------------------------------------------------------
[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