#43515 [Opn->Csd]: dir(): doc incorrectly suggests that the Directory class has a constructor

From: Date: Mon, 07 Jan 2008 20:08:12 +0000
Subject: #43515 [Opn->Csd]: dir(): doc incorrectly suggests that the Directory class has a constructor
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-418@lists.php.net to get a copy of this message
ID: 43515 Updated by: bjori@php.net Reported By: robin_fernandes at uk dot ibm dot com -Status: Open +Status: Closed Bug Type: Documentation problem Operating System: * PHP Version: Irrelevant New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [2007-12-06 10:46:16] robin_fernandes at uk dot ibm dot com Description: ------------ The documentation for the dir() function, which returns an instance of the Directory class, has a list of functions and properties for that class. It lists a non-existent constructor: Directory(string $directory). This is significant, because it incorrectly implies that it would be possible to "new up" a working instance of the Directory class by passing a path to this ctor. In fact, this will not work, because Directory has no such constructor, and the essential $handle and $path properties are created and set explicitly for each instance in the implementation of the dir() function. The reflection code below confirms that Directory::Directory($string) does not exists, and that the $handle and $path properties are created dynamically. Reproduce code: --------------- <?php ReflectionClass::export("Directory"); ?> Expected result: ---------------- N/A Actual result: -------------- Class [ <internal:standard> class Directory ] { - Constants [0] { } - Static properties [0] { } - Static methods [0] { } - Properties [0] { } - Methods [3] { Method [ <internal:standard> public method close ] { } Method [ <internal:standard> public method rewind ] { } Method [ <internal:standard> public method read ] { } } } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=43515&edit=1

« previous php.doc.bugs (#418) next »