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

From: Date: Fri, 03 Nov 2006 19:05:57 +0000
Subject: #39090 [Asn->Csd]: DirectoryFilterDots doxygen docs and example is wrong
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-104332@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 +Status: Closed Bug Type: SPL related Operating System: * PHP Version: 5.2.0 Assigned To: helly New Comment: This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2006-10-31 23:29:33] helly@php.net Fixed in 6, will get fixed in 5.2.1. ------------------------------------------------------------------------ [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 (#104332) next »