get_declared_classes
-
Both class and module names are constants. We can get the list of all classes and modules by viewing the all defined constants using
Module.constants.PHP
$result = get_declared_classes(); var_export($result); // => array(0 => 'stdClass', 1 => 'Exception', ...)
Ruby
p Module.constants # => ["TrueClass", "ObjectSpace", ...]
see also
Looking for Rails or PHP web application development, integration, and training?
Rails for PHP is brought to you by Maintainable Software. Get custom web applications and personalized training from the authors of the book and website.

