本文整理汇总了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);
}
示例2: main
function main()
{
$a = new A();
$b = new B();
$c = new C();
B::test($a);
C::test($b);
E::test($c);
}
示例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();
示例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();
示例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);
示例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());
示例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();
示例8: main
function main()
{
$c = new C();
$c->test();
}
示例9: main
function main()
{
$obj = new C();
$obj->test();
}
示例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==
示例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);
示例12: main
function main()
{
$c = new C();
$c->test();
echo "Done\n";
}
示例13: main
function main()
{
$b = new B();
$c = new C();
$c->test($b);
}
示例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()
{