#43515 [NEW]: dir(): doc incorrectly suggests that the Directory class has a constructor
| From: | robin_fernandes at uk dot ibm dot com | Date: | Thu, 06 Dec 2007 10:46:17 +0000 |
| Subject: | #43515 [NEW]: dir(): doc incorrectly suggests that the Directory class has a constructor | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-324@lists.php.net to get a copy of this message | ||
From: robin_fernandes at uk dot ibm dot com
Operating system: *
PHP version: Irrelevant
PHP Bug Type: Documentation problem
Bug description: dir(): doc incorrectly suggests that the Directory class has a constructor
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 bug report at http://bugs.php.net/?id=43515&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=43515&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=43515&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=43515&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=43515&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=43515&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=43515&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=43515&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=43515&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=43515&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=43515&r=support
Expected behavior: http://bugs.php.net/fix.php?id=43515&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=43515&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=43515&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=43515&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=43515&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=43515&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=43515&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=43515&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=43515&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=43515&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=43515&r=mysqlcfg