本文整理汇总了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"));
}
示例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();
}
示例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();
}
}
示例4: useObject
function useObject(A $obj)
{
$obj->test();
}
示例5: test
<?php
class A
{
function test($arg1, $arg2, $arg3 = 0)
{
}
}
$a = new A();
$a->test(1);
示例6: test
<?php
trait TestTrait
{
public static function test()
{
return 'Test';
}
}
class A
{
use TestTrait;
}
echo A::test();
示例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();
示例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());
示例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);
示例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');
示例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);
示例12: test
<?php
class A
{
const T = 'test';
public function test()
{
return self::T;
}
}
$f = new A();
echo $f->test();
示例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==
示例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);
示例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);