本文整理汇总了PHP中B类的典型用法代码示例。如果您正苦于以下问题:PHP B类的具体用法?PHP B怎么用?PHP B使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了B类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bar
function bar()
{
$obj = new A();
$obj->foo();
$obj = new B();
$obj->foo();
}
示例2: test
function test()
{
$v = 100;
$arr['hello'] = $v;
$a = new B();
$a->t($arr['hello'], $arr);
}
示例3: bar
function bar()
{
$obj = new A();
$obj->foo(123);
$obj = new B();
$obj->foo(123, 456);
}
示例4: test
function test()
{
$a = new A();
echo $a->foo();
$a = new B();
echo $a->foo(555);
echo $a->foo();
}
示例5: test_update_propertys_set_class
public function test_update_propertys_set_class()
{
// Mock
$csvArray = ['a' => 'a', 'b' => 'b'];
// Test
$b = new B();
$b->updateFromCSVArray($csvArray, 'B');
$this->assertEquals($b->getA(), null);
$this->assertEquals($b->getB(), 'b');
}
示例6: buildDashboard
public function buildDashboard()
{
$a = new A();
$b = new B();
$c = new C();
$b->setActive();
$this->addDashboardTab($a);
$this->addDashboardTab($b);
$this->addDashboardTab($c);
}
示例7: main
function main()
{
$x = null;
if (true) {
$x = new A();
} else {
$x = new B();
}
//TODO: it should call both methods ...
$x->foo();
//var_dump($x);
}
示例8: main
function main()
{
$c = new C();
B::test($c);
C::test($c);
D::test($c);
}
示例9: test
function test()
{
(new B())->foo();
(new B())->bar();
(new B())->baz();
B::baz();
}
示例10: foo2
public function foo2()
{
B::foo();
// B always changes 'static'
self::foo();
// 'self' doesn't change 'static'
}
示例11: f
public static function f()
{
B::g1();
parent::g1();
C::g2();
self::g2();
}
示例12: testAppendChild
public function testAppendChild()
{
$node = new Node();
$node->appendChild($a = new A());
$b = new B($node);
$node->prependChild($c = new C());
$node->appendChild($d = new D());
$this->assertEquals(1, $a->getIndex());
$this->assertEquals(2, $b->getIndex());
$this->assertEquals(0, $c->getIndex());
$this->assertEquals(3, $d->getIndex());
$this->assertInstanceOf(A::class, $node->getChildAt(1));
$this->assertInstanceOf(B::class, $node->getChildAt(2));
$this->assertInstanceOf(C::class, $node->getChildAt(0));
$this->assertInstanceOf(D::class, $node->getChildAt(3));
}
示例13: test
function test()
{
A::test1(1, 'a');
B::test2(1, 'a');
self::test3(1, 'a');
parent::test4(1, 'a');
}
示例14: testSingleton
/**
* Test the getInstance method
*/
public function testSingleton()
{
$a1 = A::getInstance();
$a2 = A::getInstance();
$this->assertEquals($a1, $a2);
$b = B::getInstance();
$this->assertNotEquals($a1, $b);
}
示例15: test
function test()
{
self::test1();
parent::test2();
static::test3();
A::test4();
B::test5();
C::test6();
}