Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

get_called_class

Description

The get_called_class of Class / Object for PHP the "Late Static Binding" class name.

Syntax

get_called_class ( void ) : string

Return

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

Examples

1

<?

class myclass1
{
    static public function myfunction()
    {
        $return = get_called_class();

        echo $return . PHP_EOL;
    }
}
class myclass2 extends myclass1
{
}

myclass1::myfunction();
myclass2::myfunction();

?>
myclass1
myclass2
HomeMenu