PHP get_declared_classes() function
In this chapter you will learn:
- When to use PHP get_declared_classes() function
- Syntax for PHP get_declared_classes() function
- Return Values
- Example - get the declared classes
Description
get_declared_classes() returns an array of all classes of which you can currently create an object.
Syntax
array get_declared_classes ( void )
Return Values
Returns an array of the names of the declared classes in the current script.
Example
Get the declared classes
<?php
print_r(get_declared_classes());
?>
The code above generates the following result.
Next chapter...
What you will learn in the next chapter:
- What is PHP get_declared_interfaces() function
- Syntax for PHP get_declared_interfaces() function
- Return Values
- Example - Get all declared interfaces
Home » PHP Tutorial » PHP Class Functions