Manuel PHP
get_called_class
(No version information available, might be only in CVS)
get_called_class — the "Late Static Binding" class name
Description
string get_called_class
( void
)
Gets the name of the class the static method is called in.
Valeurs de retour
Returns the class name. Returns FALSE if called from outside a class.
Exemples
Exemple #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();
- ?>
L'exemple ci-dessus va afficher :
string(3) "foo"
string(3) "bar"
Remonter 
