note 61774 added to class.dir
| From: | php-general at lists dot php dot net | Date: | Sat, 11 Feb 2006 17:48:12 +0000 |
| Subject: | note 61774 added to class.dir | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-103512@lists.php.net to get a copy of this message | ||
There's a mistake in this guide. If you try to check declared classes in php4.1 or more you
will notice that no "dir" or "Dir" class exists but instead a
"Directory" class do; indeed if you declare a class with name "Directory" the
compiler will return a "already declared class" error but no such error will appear if you
declare a "Dir" or "dir" class. Also, imo, there is no the need of a
"dir" class with 3 simple methods because it would be easier to implement a custom
directory class than using the one provided by php.
Here the code to check this fault:
$arr = get_declared_classes();
print_r($arr);
print_r(get_class_methods($arr[array_search("Directory",$arr)]));
print_r(get_class_methods($arr[array_search("dir",$arr)]));
----
Server IP: 213.92.11.19
Probable Submitter: 82.51.58.153
----
Manual Page -- http://www.php.net/manual/en/class.dir.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+61774
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+61774&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+61774&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+61774&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+61774&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+61774&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+61774&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+61774&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+61774&report=yes
Search -- http://master.php.net/manage/user-notes.php