当前位置: 首页>>代码示例>>PHP>>正文


PHP A::test方法代码示例

本文整理汇总了PHP中A::test方法的典型用法代码示例。如果您正苦于以下问题:PHP A::test方法的具体用法?PHP A::test怎么用?PHP A::test使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在A的用法示例。


在下文中一共展示了A::test方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testNoForward

 public static function testNoForward()
 {
     A::test();
     call_user_func("A::test");
     call_user_func(array("A", "test"));
     B::test();
     call_user_func("B::test");
     call_user_func(array("B", "test"));
 }
开发者ID:badlamer,项目名称:hhvm,代码行数:9,代码来源:lsb_021.php

示例2: main

function main()
{
    call_user_func(array('A', 'private_func'), "1", "2", "3");
    call_user_func(array('A', 'protected_func'), "1", "2", "3");
    call_user_func(array('A', 'public_func'), "1", "2", "3");
    call_user_func(array('B', 'private_func'), "1", "2", "3");
    call_user_func(array('B', 'protected_func'), "1", "2", "3");
    call_user_func(array('B', 'public_func'), "1", "2", "3");
    A::test();
    B::test();
}
开发者ID:badlamer,项目名称:hhvm,代码行数:11,代码来源:cuf__callStatic3.php

示例3: mycatch

 public static function mycatch()
 {
     try {
         static::who();
         B::throwException_after();
     } catch (Exception $e) {
         static::who();
         A::test();
         static::who();
         B::test();
         static::who();
         self::simpleCatch();
         static::who();
     }
 }
开发者ID:badlamer,项目名称:hhvm,代码行数:15,代码来源:lsb_015.php

示例4: useObject

function useObject(A $obj)
{
    $obj->test();
}
开发者ID:sidorenkosergey,项目名称:Cross,代码行数:4,代码来源:index.php

示例5: test

<?php

class A
{
    function test($arg1, $arg2, $arg3 = 0)
    {
    }
}
$a = new A();
$a->test(1);
开发者ID:hslatman,项目名称:phan,代码行数:10,代码来源:0009_method_call.php

示例6: test

<?php

trait TestTrait
{
    public static function test()
    {
        return 'Test';
    }
}
class A
{
    use TestTrait;
}
echo A::test();
开发者ID:badlamer,项目名称:hhvm,代码行数:14,代码来源:static_001.php

示例7: test

<?php

final class A
{
    //final public $name = 'ss'; //Fatal error: Cannot declare property A::$name final, the final modifier is allowed only for methods and classes
    public function test()
    {
        ///$this->name = 'overrided name';
        return 'dd';
    }
}
$a = new A();
echo $a->test();
开发者ID:yogendra9891,项目名称:basic,代码行数:13,代码来源:final.php

示例8: __construct

<?php

class A
{
    public $a = 1;
    public static $A = 2;
    private $b = 3;
    private static $B = 4;
    protected $c = 5;
    protected static $C = 6;
    public function __construct()
    {
        var_dump(get_class_vars('A'));
    }
    public static function test()
    {
        var_dump(get_class_vars('A'));
    }
}
var_dump(get_class_vars('A'));
new A();
var_dump(A::test());
开发者ID:badlamer,项目名称:hhvm,代码行数:22,代码来源:get_class_vars_004.php

示例9: test

<?php

interface I
{
    public function test($a);
}
class A
{
    public function test($a)
    {
        print 'A';
    }
}
class B extends A implements I
{
    public function test($a)
    {
        print 'B';
    }
}
$obj = new A();
$obj->test(1);
$obj = new B();
$obj->test(1);
开发者ID:badlamer,项目名称:hhvm,代码行数:24,代码来源:652.php

示例10: test

<?php

interface I
{
    public function test($a);
}
class A implements I
{
    public function test($a)
    {
        print $a;
    }
}
$obj = new A();
var_dump($obj instanceof I);
$obj->test('cool');
开发者ID:badlamer,项目名称:hhvm,代码行数:16,代码来源:651.php

示例11: A

<?php

class A
{
    function __call($a, $b)
    {
        $b = 'a';
        $b = 1;
        var_dump($a, $b[0], $b[1]);
    }
}
$obj = new A();
$a = 1;
$b = 'a';
$b = 2;
$obj->test($a, $b);
开发者ID:badlamer,项目名称:hhvm,代码行数:16,代码来源:1270.php

示例12: test

<?php

class A
{
    const T = 'test';
    public function test()
    {
        return self::T;
    }
}
$f = new A();
echo $f->test();
开发者ID:yogendra9891,项目名称:basic,代码行数:12,代码来源:f.php

示例13: 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

示例14: 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

示例15: test

<?php

class A
{
    public function test($a)
    {
        var_dump(func_num_args());
        var_dump(func_get_args());
    }
}
$obj = new A();
$obj->test('test');
$obj->test(1, 2, 3);
开发者ID:badlamer,项目名称:hhvm,代码行数:13,代码来源:18.php


注:本文中的A::test方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。