English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Basic PHP tutorial

Advanced PHP tutorial

PHP & MySQL

PHP reference manual

PHP get_declared_classes() function usage and example

PHP Class/Object function reference manual

The get_declared_classes() function returns an array composed of the names of the defined classes

Syntax

get_declared_classes(void);

Definition and usage

 Returns an array composed of the names of classes defined in the current script.

Parameter

Serial numberParameters and descriptions
1

void

void indicates that no parameters are required.

Return value

 Returns an array composed of the names of classes defined in the current script.

Online examples

The following is the usage of this function-

<?php
   print_r(get_declared_classes());
?>
Test to see‹/›

It will produce the following results-

The output has been shortened for viewing purposes.

Array (
   [0] => stdClass
   [1]]=> __PHP_Incomplete_Class
   [2]]=> Directory
   ...
   ...    	 
)

   PHP Class/Object function reference manual