VOOZH about

URL: https://web.archive.org/web/20081225211913/http://devzone.zend.com/manual/function.get-class.html

โ‡ฑ Zend Developer Zone


Zend Developer Zone - Advancing the art of PHP

Processing login. Please wait...



๐Ÿ‘ Image
Rss๐Ÿ‘ Image
Atom

Quick Links


Categories


Loading feed
Loading feed
Loading feed

Information

PHP Manual
PrevNext

get_class

(PHP 4, PHP 5)

get_class -- Returns the name of the class of an object

Description

string get_class ( [object object] )

Gets the name of the class of the given object.

Parameters

object

The tested object

Return Values

Returns the name of the class of which object is an instance. Returns if object is not an object.

ChangeLog

VersionDescription
Since 5.0.0 The class name is returned in it's original notation.
Since 5.0.0 The object parameter is optional if called from the object's method.

Examples

Example 1. Using get_class()

The above example will output:

Its name is foo
My name is foo

See Also

get_parent_class()
gettype()
is_subclass_of()

PrevHomeNext
get_class_varsUpget_declared_classes
๐Ÿ‘ Image
๐Ÿ‘ Image
Loading feed
๐Ÿ‘ Image
Copyright ยฉ 1999 - 2008 by Zend Technologies Ltd. All rights reserved.
Zend is a trademark of Zend Technologies Ltd.