Reputation: 1373
I'm making the leap to OOP with my PHP. Is there a way to list all active classes and their methods and properties?
Upvotes: 6
Views: 1679
Reputation: 30985
Also, you might be interested in the Reflection API offered by PHP.
As they claim in their introduction:
PHP 5 comes with a complete reflection API that adds the ability to reverse-engineer classes, interfaces, functions, methods and extensions. Additionally, the reflection API offers ways to retrieve doc comments for functions, classes and methods.
Upvotes: 4
Reputation: 382656
Complete list of similar functions :)
Quick Look:
get_declared_classes() // gives you all declared classes
get_class_methods() // gives you all methods of class
get_class_vars() // gives you properties of the class
get_object_vars() // gives you propertis of an object
get_parent_class() // gives you parent class of the current class
Upvotes: 7