note 47056 added to function.get-declared-classes
| From: | matt-php at DONT-SPAM-ME dot bitdifferent dot com | Date: | Mon, 01 Nov 2004 15:41:05 +0000 |
| Subject: | note 47056 added to function.get-declared-classes | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-79457@lists.php.net to get a copy of this message | ||
The array returned by this function will be in the order the classes were defined / included /
required and this order does not appear to change.
For example:
<?PHP
//define classone
class classone { }
//define classtwo
class classtwo { }
//This will show X classes (built-ins, extensions etc) with
//classone and classtwo as the last two elements
print_r(get_declared_classes());
//define classthree
class classthree { }
//...and four
class classfour { }
//Shows the same result as before with class three and four appended
print_r(get_declared_classes());
?>
Output:
Array
(
[0] => stdClass
[1] .... other defined classes....
[10] => classone
[11] => classtwo
)
and...
Array
(
[0] => stdClass
[1] .... other defined classes....
[10] => classone
[11] => classtwo
[12] => classthree
[13] => classfour
)
----
Manual Page -- http://www.php.net/manual/en/function.get-declared-classes.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+47056
Delete -- http://master.php.net/manage/user-notes.php?action=delete+47056&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47056&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47056&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47056&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47056&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47056&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+47056&report=yes
Search -- http://master.php.net/manage/user-notes.php