コード例 #1
0
ファイル: protected_001b.php プロジェクト: dw4dev/Phalanger
[expect php]
[file]
<?php 
error_reporting(0);
class pass
{
    protected function fail()
    {
        echo "Call fail()\n";
    }
    public function good()
    {
        $this->fail();
    }
}
$t = new pass();
$t->good();
$t->fail();
// must fail because we are calling from outside of class pass
echo "Done\n";
// shouldn't be displayed
コード例 #2
0
ファイル: protected_001.php プロジェクト: dw4dev/Phalanger
[expect php]
[file]
<?php 
error_reporting(0);
class pass
{
    protected static function fail()
    {
        echo "Call fail()\n";
    }
    public static function good()
    {
        pass::fail();
    }
}
pass::good();
pass::fail();
// must fail because we are calling from outside of class pass
echo "Done\n";
// shouldn't be displayed
コード例 #3
0
ファイル: private_003.php プロジェクト: dw4dev/Phalanger
 static function ok()
 {
     pass::good();
 }