本文整理汇总了PHP中A::a方法的典型用法代码示例。如果您正苦于以下问题:PHP A::a方法的具体用法?PHP A::a怎么用?PHP A::a使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类A
的用法示例。
在下文中一共展示了A::a方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: a
public function a()
{
if (null === ($rs = parent::a())) {
$rs = new B();
}
return $rs;
}
示例2: main
function main()
{
echo "main\n";
A::$a = 30;
$x =& A::$a;
print $x . A::$a . "\n";
$x = 5;
print $x . A::$a . "\n";
}
示例3: testMock
public function testMock()
{
$manager = ClassManager::getInstance();
$manager->register('StaticMock\\MethodReplacer\\A', 'a', function () {
return 3;
});
$manager->register('StaticMock\\MethodReplacer\\B', 'b', function () {
return 4;
});
$this->assertEquals(3, A::a());
$this->assertEquals(4, B::b());
$manager->deregister('StaticMock\\MethodReplacer\\A', 'a');
$manager->deregister('StaticMock\\MethodReplacer\\B', 'b');
$this->assertEquals(1, A::a());
$this->assertEquals(2, B::b());
}
示例4: test
function test()
{
$obj = new A();
$obj->a();
}
示例5: a
}
}
interface I
{
public function a(int $a1 = 0);
public function b(array $b1 = null);
}
class B implements I
{
public function a(int $a1 = null, int $z1 = 1, int $z2 = D2, int $z3 = 3, int $z4 = null)
{
}
public function b(array $b1 = null, array $y = array(), int $z1 = 1, int $z2 = 2, double $z3 = 3.0, string $z4 = "abc")
{
}
}
$a = new A();
$a->a();
$a->b();
$a->d();
$a->f();
$a->i();
$a->s();
$a->c();
$a->c($a);
$a->c(null);
$a->z();
$b = new B();
$b->a();
$b->b();
print "Pass\n";
示例6: test_canCallreplacedMethodMultipleTimes
public function test_canCallreplacedMethodMultipleTimes()
{
$mock = new ClassMethodReplacementGuard();
$mock->replace('StaticMock\\MethodReplacer\\A', 'a', function () {
return 3;
});
$this->assertEquals(3, A::a());
$this->assertEquals(3, A::a());
}
示例7: a
public function a()
{
parent::a();
print __METHOD__ . "\n";
}
示例8: init
public static function init()
{
self::$a = 123;
}