当前位置: 首页>>代码示例>>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;未经允许,请勿转载。