|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-01-07 20:08 UTC] bjori@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 07 11:00:02 2026 UTC |
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 ] { } } }