本文整理汇总了PHP中B类的典型用法代码示例。如果您正苦于以下问题:PHP B类的具体用法?PHP B怎么用?PHP B使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了B类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: bar
function bar()
{
$obj = new A();
$obj->foo();
$obj = new B();
$obj->foo();
}
开发者ID:badlamer,项目名称:hhvm,代码行数:7,代码来源:76.php
示例2: test
function test()
{
$v = 100;
$arr['hello'] = $v;
$a = new B();
$a->t($arr['hello'], $arr);
}
开发者ID:badlamer,项目名称:hhvm,代码行数:7,代码来源:1090.php
示例3: bar
function bar()
{
$obj = new A();
$obj->foo(123);
$obj = new B();
$obj->foo(123, 456);
}
开发者ID:badlamer,项目名称:hhvm,代码行数:7,代码来源:78.php
示例4: test
function test()
{
$a = new A();
echo $a->foo();
$a = new B();
echo $a->foo(555);
echo $a->foo();
}
开发者ID:iolevel,项目名称:peachpie,代码行数:8,代码来源:overloading_002.php
示例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');
}
开发者ID:Talk-Point,项目名称:TPFoundation,代码行数:10,代码来源:PropertyArrayUpdateTest.php
示例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);
}
开发者ID:luyaotsung,项目名称:framework,代码行数:10,代码来源:tabbed_standalone.php
示例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);
}
开发者ID:Halfnhav4,项目名称:pfff,代码行数:12,代码来源:if_flow2.php
示例8: main
function main()
{
$c = new C();
B::test($c);
C::test($c);
D::test($c);
}
开发者ID:badlamer,项目名称:hhvm,代码行数:7,代码来源:typehint_lsb_self.php
示例9: test
function test()
{
(new B())->foo();
(new B())->bar();
(new B())->baz();
B::baz();
}
开发者ID:badlamer,项目名称:hhvm,代码行数:7,代码来源:closure_bug66622.php
示例10: foo2
public function foo2()
{
B::foo();
// B always changes 'static'
self::foo();
// 'self' doesn't change 'static'
}
开发者ID:badlamer,项目名称:hhvm,代码行数:7,代码来源:1877.php
示例11: f
public static function f()
{
B::g1();
parent::g1();
C::g2();
self::g2();
}
开发者ID:badlamer,项目名称:hhvm,代码行数:7,代码来源:FPushClsMethodF.php
示例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));
}
开发者ID:talesoft,项目名称:tale-tree,代码行数:16,代码来源:NodeTest.php
示例13: test
function test()
{
A::test1(1, 'a');
B::test2(1, 'a');
self::test3(1, 'a');
parent::test4(1, 'a');
}
开发者ID:badlamer,项目名称:hhvm,代码行数:7,代码来源:__call_004.php
示例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);
}
开发者ID:nimbles,项目名称:Framework,代码行数:11,代码来源:SingletonTest.php
示例15: test
function test()
{
self::test1();
parent::test2();
static::test3();
A::test4();
B::test5();
C::test6();
}
开发者ID:badlamer,项目名称:hhvm,代码行数:9,代码来源:bug42937.php
示例16: main
function main()
{
$a = new A();
$b = new B();
$c = new C();
B::test($a);
C::test($b);
E::test($c);
}
开发者ID:badlamer,项目名称:hhvm,代码行数:9,代码来源:typehint_lsb_parent.php
示例17: cf
function cf()
{
A1::f();
A2::f();
\A1::f();
\A2::f();
B::f();
C::f();
}
开发者ID:exakat,项目名称:exakat,代码行数:9,代码来源:IsNotFamily.02.php
示例18: __construct
public function __construct()
{
self::callNonStaticMethod();
static::callNonStaticMethod();
parent::callNonStaticMethod();
\NS1\A::callNonStaticMethod();
\NS1\A::callNonStaticMethod();
\NS2\B::callNonStaticMethod();
}
开发者ID:tpunt,项目名称:phan,代码行数:9,代码来源:0143_nonstaticcalls.php
示例19: 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
示例20: callStatics
public function callStatics()
{
self::callNonStaticMethod();
static::callNonStaticMethod();
parent::callNonStaticMethod();
\NS1\A::callNonStaticMethod();
\NS1\A::callNonStaticMethod();
\NS2\B::callNonStaticMethod();
}
开发者ID:etsy,项目名称:phan,代码行数:9,代码来源:0143_nonstaticcalls.php
注:本文中的B类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论