【php】【特殊案例】数组调用方法

As of PHP 5.4.0, you can call any callable stored in a variable.


<?php
class Foo
{
    static function bar()
    {
        echo "bar
";
    }
    function baz()
    {
        echo "baz
";
    }
}

$func = array("Foo", "bar");
$func(); // prints "bar"
原文地址:https://www.cnblogs.com/china-flint/p/9701071.html