php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39090 DirectoryFilterDots doxygen docs and example is wrong
Submitted: 2006-10-09 09:51 UTC Modified: 2006-11-03 19:05 UTC
From: judas dot iscariote at gmail dot com Assigned: helly (profile)
Status: Closed Package: SPL related
PHP Version: 5.2.0 OS: *
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: judas dot iscariote at gmail dot com
New email:
PHP Version: OS:

 

 [2006-10-09 09:51 UTC] 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....



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-10-31 23:29 UTC] helly@php.net
Fixed in 6, will get fixed in 5.2.1.
 [2006-11-03 19:05 UTC] helly@php.net
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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Nov 23 07:01:29 2024 UTC