Esempio n. 1
0
    {
        return new self($name, $option);
    }
    private static function hello($prefix)
    {
        $name = self::$name;
        echo "Hello, {$prefix} {$name}!" . EOL;
    }
    private function hi($prefix)
    {
        $name = self::$name;
        echo "Hi, {$prefix} {$name}!" . EOL;
    }
}
echo "Test1" . EOL;
$test = Hello::getIns("xiaohong");
$say1 = new ProxyMethod($test);
$say1->hi("Miss.");
// Hi, Miss. xiaohong!
$say1::hello("Miss.");
// Hello, Miss. xiaohong!
$say1->test();
// test inheritance
$say1::staticTest();
// test inheritance, static
$say1->export("hello");
$say1->export("hi");
hi($test, "Miss.");
// Hi, Miss. xiaohong!
hello("Miss.");
// Hello, Miss. xiaohong!