當前位置: 首頁>>代碼示例>>PHP>>正文


PHP C::test方法代碼示例

本文整理匯總了PHP中C::test方法的典型用法代碼示例。如果您正苦於以下問題:PHP C::test方法的具體用法?PHP C::test怎麽用?PHP C::test使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在C的用法示例。


在下文中一共展示了C::test方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: main

function main()
{
    $c = new C();
    B::test($c);
    C::test($c);
    D::test($c);
}
開發者ID:badlamer,項目名稱:hhvm,代碼行數:7,代碼來源:typehint_lsb_self.php

示例2: main

function main()
{
    $a = new A();
    $b = new B();
    $c = new C();
    B::test($a);
    C::test($b);
    E::test($c);
}
開發者ID:badlamer,項目名稱:hhvm,代碼行數:9,代碼來源:typehint_lsb_parent.php

示例3: backtrace

    }
}
class B
{
    use T2 {
        t2method as Bmethod;
    }
}
class C extends A
{
}
trait T1
{
    protected function backtrace()
    {
        $b = new B();
        $b->Bmethod();
    }
}
trait T2
{
    public function t2method()
    {
        print_r(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1));
    }
}
$a = new A();
$a->test();
$c = new C();
$c->test();
開發者ID:badlamer,項目名稱:hhvm,代碼行數:30,代碼來源:bug64239_2.php

示例4: test

<?php

define("FOO", 123);
trait T
{
    private $blah = FOO;
    public function test()
    {
        var_dump($this->blah);
    }
}
class C
{
    use T;
}
$obj = new C();
$obj->test();
開發者ID:badlamer,項目名稱:hhvm,代碼行數:17,代碼來源:traits.php

示例5: test

<?php

class C
{
    public function test()
    {
        unset($this);
        return get_defined_vars();
    }
}
$c = new C();
$x = $c->test();
print_r($x);
unset($c, $x);
開發者ID:zaky-92,項目名稱:php-1,代碼行數:14,代碼來源:Zend_tests_bug68370.php

示例6: f

class C
{
    /**
     * @return self
     */
    function f()
    {
        return $this;
    }
    /**
     * @return static
     */
    function g()
    {
        return $this;
    }
    /**
     * @return $this
     */
    function h()
    {
        return $this;
    }
    function test(C $c)
    {
    }
}
$c = new C();
$f = $c->test($c->f());
$g = $c->test($c->g());
$h = $c->test($c->h());
開發者ID:ablyler,項目名稱:phan,代碼行數:31,代碼來源:0053_self_static_this.php

示例7: foo

    public static function foo()
    {
        static::who();
    }
    public static function who()
    {
        echo __CLASS__ . "\n";
    }
}
class B extends A
{
    public static function test()
    {
        A::foo();
        parent::foo();
        self::foo();
    }
    public static function who()
    {
        echo __CLASS__ . "\n";
    }
}
class C extends B
{
    public static function who()
    {
        echo __CLASS__ . "\n";
    }
}
C::test();
開發者ID:jinliangzhou,項目名稱:Accumulate,代碼行數:30,代碼來源:staticexam4.php

示例8: main

function main()
{
    $c = new C();
    $c->test();
}
開發者ID:Halfnhav4,項目名稱:pfff,代碼行數:5,代碼來源:classes_field.php

示例9: main

function main()
{
    $obj = new C();
    $obj->test();
}
開發者ID:badlamer,項目名稱:hhvm,代碼行數:5,代碼來源:call11.php

示例10: test

<?php

class A
{
    public static function test($x = null)
    {
        if (!is_null($x)) {
            echo "{$x}\n";
        }
        return get_called_class();
    }
}
class B extends A
{
}
class C extends A
{
}
class D extends A
{
}
echo A::test(B::test(C::test(D::test()))) . "\n";
?>
==DONE==
開發者ID:badlamer,項目名稱:hhvm,代碼行數:24,代碼來源:lsb_017.php

示例11: var_dump

        var_dump(get_object_vars($b));
    }
}
class C extends B
{
    private $hiddenPriv = 'C::hiddenPriv';
    public static function test($b)
    {
        echo __METHOD__ . "\n";
        var_dump(get_object_vars($b));
    }
}
class X
{
    public static function test($b)
    {
        echo __METHOD__ . "\n";
        var_dump(get_object_vars($b));
    }
}
$b = new B();
echo "\n---( Global scope: )---\n";
var_dump(get_object_vars($b));
echo "\n---( Declaring class: )---\n";
B::test($b);
echo "\n---( Subclass: )---\n";
C::test($b);
echo "\n---( Superclass: )---\n";
A::test($b);
echo "\n---( Unrelated class: )---\n";
X::test($b);
開發者ID:badlamer,項目名稱:hhvm,代碼行數:31,代碼來源:get_object_vars_basic_001.php

示例12: main

function main()
{
    $c = new C();
    $c->test();
    echo "Done\n";
}
開發者ID:badlamer,項目名稱:hhvm,代碼行數:6,代碼來源:assignment-to-this.php

示例13: main

function main()
{
    $b = new B();
    $c = new C();
    $c->test($b);
}
開發者ID:badlamer,項目名稱:hhvm,代碼行數:6,代碼來源:prop-access-error2.php

示例14: who

class D
{
    public static function who()
    {
        echo "D\n";
    }
}
class E extends D
{
    public static function who()
    {
        echo "E\n";
    }
}
$o = new C();
$o->test();
class O
{
    public function who()
    {
        echo "O\n";
    }
}
class P extends O
{
    function __toString()
    {
        return '$this';
    }
    public function who()
    {
開發者ID:badlamer,項目名稱:hhvm,代碼行數:31,代碼來源:callbacks_001.php


注:本文中的C::test方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。