php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #41914 DirectoryIterator:getChildren does not exists
Submitted: 2007-07-06 08:39 UTC Modified: 2007-08-16 12:44 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: pcdinh at gmail dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: Windows XP Sp2
Private report: No CVE-ID: None
 [2007-07-06 08:39 UTC] pcdinh at gmail dot com
Description:
------------
The method getChildren of DirectoryIterator does not exists in PHP 5.2.3 and PHP 5.2.4 dev but the PHP Manual does not say anything about it.

Reproduce code:
---------------
dataDir           = './data';
$directoryIterator = new DirectoryIterator($dataDir);

foreach ($directoryIterator as $idDir)
{
	if ($directoryIterator->isDot())
	{
		continue;
	}

	if ($directoryIterator->isDir())
	{
		$companyId           = $idDir->getFileName();

		// Report directory iterator
		$subDirIterator      = $idDir->getChildren(); //bug
        }
}



Expected result:
----------------
DirectoryIterator::getChildren() should return a RecursiveDirectoryIterator as stated in the PHP Manual

Actual result:
--------------
Fatal error: Call to undefined method DirectoryIterator::getChildren() in D:\wvbsrc\newswire\Edinet\test.php on line 18

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-08-16 12:44 UTC] vrana@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.

Function removed.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 15 01:01:35 2025 UTC