コード例 #1
0
ファイル: callbacks_001.php プロジェクト: badlamer/hhvm
    }
}
class P extends O
{
    function __toString()
    {
        return '$this';
    }
    public function who()
    {
        echo "P\n";
    }
    public function call($cb)
    {
        echo join('|', $cb) . "\n";
        call_user_func($cb);
    }
    public function test()
    {
        $this->call(array('parent', 'who'));
        $this->call(array('P', 'parent::who'));
        $this->call(array($this, 'O::who'));
        $this->call(array($this, 'B::who'));
    }
}
echo "===FOREIGN===\n";
$o = new P();
$o->test();
?>
===DONE===