#39090 [Asn]: DirectoryFilterDots doxygen docs and example is wrong

From: Date: Tue, 31 Oct 2006 23:29:34 +0000
Subject: #39090 [Asn]: DirectoryFilterDots doxygen docs and example is wrong
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-104239@lists.php.net to get a copy of this message
ID: 39090 Updated by: helly@php.net Reported By: judas dot iscariote at gmail dot com Status: Assigned Bug Type: SPL related -Operating System: Irrelevant +Operating System: * -PHP Version: 5CVS-2006-10-09 (CVS) +PHP Version: 5.2.0 Assigned To: helly New Comment: Fixed in 6, will get fixed in 5.2.1. 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

« previous php.bugs (#104239) next »