PHP get_declared_classes() function

In this chapter you will learn:

  1. When to use PHP get_declared_classes() function
  2. Syntax for PHP get_declared_classes() function
  3. Return Values
  4. 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:

  1. What is PHP get_declared_interfaces() function
  2. Syntax for PHP get_declared_interfaces() function
  3. Return Values
  4. Example - Get all declared interfaces
Home » PHP Tutorial » PHP Class Functions
PHP class_exists() function
PHP get_class() function
PHP get_declared_classes() function
PHP get_declared_interfaces() function
PHP get_defined_functions() function
PHP instanceof
PHP serialize() function