downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

get_class_methods> <class_exists
Last updated: Fri, 11 Dec 2009

view this page in

get_called_class

(PHP 5 >= 5.3.0)

get_called_classthe "Late Static Binding" class name

Description

string get_called_class ( void )

Gets the name of the class the static method is called in.

Return Values

Returns the class name. Returns FALSE if called from outside a class.

Examples

Example #1 Using get_called_class()

<?php

class foo {
    static public function 
test() {
        
var_dump(get_called_class());
    }
}

class 
bar extends foo {
}

foo::test();
bar::test();

?>

The above example will output:

string(3) "foo"
string(3) "bar"

See Also



add a note add a note User Contributed Notes
get_called_class
There are no user contributed notes for this page.

get_class_methods> <class_exists
Last updated: Fri, 11 Dec 2009
 
 
show source | credits | sitemap | contact | advertising | mirror sites