Cyrcle
Cyrcle

Reputation: 1373

Possible to list all PHP classes and their methods and properties?

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

Answers (3)

Roberto Aloi
Roberto Aloi

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

Sarfraz
Sarfraz

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

Related Questions