#39090 [Opn->Asn]: DirectoryFilterDots doxygen docs and example is wrong
| From: | tony2001@php.net | Date: | Mon, 09 Oct 2006 09:55:59 +0000 |
| Subject: | #39090 [Opn->Asn]: DirectoryFilterDots doxygen docs and example is wrong | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-103290@lists.php.net to get a copy of this message | ||
ID: 39090
Updated by: tony2001@php.net
Reported By: judas dot iscariote at gmail dot com
-Status: Open
+Status: Assigned
Bug Type: SPL related
Operating System: Irrelevant
PHP Version: 5CVS-2006-10-09 (CVS)
-Assigned To:
+Assigned To: helly
Previous Comments:
------------------------------------------------------------------------
[2006-10-09 09:51:55] judas dot iscariote at gmail dot com
Description:
------------
DirectoryFilterDots example [1] ) and docs [2] are wrong.
example [1] says :
parent::__construct(new DirectoryIterator($path));
must say :
parent::__construct(new RecursiveDirectoryIterator($path));
Documentation say:
This Iteraotr takes a pathname from which it creates a
DirectoryIterator...
must say :
This **Iterator** takes a pathname from which it creates a
**RecursiveDirectoryIterator**...
[1] ext/spl/examples/directoryfilterdots.inc
[2] http://www.php.net/~helly/php/ext/spl/classDirectoryFilterDots.html
Reproduce code:
---------------
<?php
require_once dirname(__FILE__) . '/directoryfilterdots.inc';
$foo = new DirectoryFilterDots(dirname(__FILE__));
?>
Expected result:
----------------
shiny new iterator containing the directory listing without dots.
Actual result:
--------------
Catchable fatal error: Argument 1 passed to
RecursiveFilterIterator::__construct() must implement interface
RecursiveIterator, instance of DirectoryIterator given....
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39090&edit=1