[PHP面向对象]①②--__call/__callStatic

[PHP面向对象]①②--__call/__callStatic_第1张图片
Paste_Image.png
";
    }

    public static function __callStatic($name, $arguments)
    {
        echo "Calling static " . $name . " with parameters: " . implode(",", $arguments) . "
"; } } $obj = new MagicTest(); $obj->runTest('para1', 'para2');//Calling runTest with parameters: para1,para2 MagicTest::runTtest("para1", "para2");//Calling static runTtest with parameters: para1,para2
Paste_Image.png

你可能感兴趣的:([PHP面向对象]①②--__call/__callStatic)