コード例 #1
0
ファイル: test114.php プロジェクト: Beryl-bingqi/pixy
<? //


// enhanced method resolution using
// $this and static hints

echo Foo::blob();   // Foo
echo Bar::blob();   // Bar
echo $o->gaga();    // Foo
echo $p->blob();    // not resolvable

class Foo {
    function blob() {
        return $_GET['in_foo'];
    }
    function gaga() {
        return $this->blob();
    }
}

class Bar {
    function blob() {
        return $_GET['in_bar'];
    }
}





?>
コード例 #2
0
ファイル: test114.php プロジェクト: 9Yg1rxeSeha90ZU1/pixy
<?php

//
// enhanced method resolution using
// $this and static hints
echo Foo::blob();
// Foo
echo Bar::blob();
// Bar
echo $o->gaga();
// Foo
echo $p->blob();
// not resolvable
class Foo
{
    function blob()
    {
        return $_GET['in_foo'];
    }
    function gaga()
    {
        return $this->blob();
    }
}
class Bar
{
    function blob()
    {
        return $_GET['in_bar'];
    }
}