コード例 #1
0
<?php

class ParentBase
{
    public static function render()
    {
        return get_called_class();
        //获得当前类的调用场景
    }
}
class Descendant extends ParentBase
{
}
echo Descendant::render();
echo '<hr/>';
// __callStatic() 魔术方法(调用一个不存在的静态方法是使用)
class MyClass
{
    public static function __callStatic($name, $parameters)
    {
        echo $name . ' method called. Paramters: ' . PHP_EOL . var_export($parameters, true) . PHP_EOL;
    }
}
//       $name||$parameters
MyClass::bogus(1, false, 'a');