Part1 – Using the ReflectionClass in PHP to get basic information about a class.

Build the Refelection Class

$class = new ReflectionClass($className);

$className – can be the name of any class

Get the name of the class:

echo $class->getName()

Get the name of the file that contains the class:

echo $class->getFileName()

Get the class inherited by this class:

echo $class->getParentClass();

Get all the list of all parent classes (inheritance):

$parents = array();
while ($parent =  $parent->getParentClass())
	$parents[] = $parent;

They will be of ReflectionClass type too, so you can use the same functions on them.

Get the classes constants:


Get the classes properties:


All methods of ReflectionClass can be found here: