PHP Manualget_class(PHP 4, PHP 5) get_class — Returns the name of the class of an object Description
string get_class
([ object
$object = NULL
] )
Gets the name of the class of the given Parameters
Return Values
Returns the name of the class of which
If Errors/Exceptions
If get_class() is called with anything other than an
object, an Changelog
Examples
Example #1 Using get_class()
<?php The above example will output: Its name is foo My name is foo Example #2 Using get_class() in superclass
<?php The above example will output: string(3) "foo" string(3) "bar" See Also
![]() |
PHP-Index
New Tutorial entries
|