本文整理汇总了PHP中B::hello方法的典型用法代码示例。如果您正苦于以下问题:PHP B::hello方法的具体用法?PHP B::hello怎么用?PHP B::hello使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类B
的用法示例。
在下文中一共展示了B::hello方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: instance_test
}
}
class B extends A
{
static function attr_test()
{
echo parent::$a;
}
static function method_test()
{
echo parent::modified_a();
}
public function instance_test()
{
echo parent::hello();
}
public function hello()
{
echo "*******";
parent::hello();
echo "*******";
}
}
echo B::$a . "<br />";
echo B::modified_a() . "<br />";
echo B::attr_test() . "<br />";
echo B::method_test() . "<br />";
$object = new B();
$object->instance_test();
$object->hello();
示例2: getParentName
}
}
class B extends A implements Family, Postal{
public function getParentName() {
}
public function getAddress() {
}
static $word = "bye";
}
B::hello();
echo "" . PHP_EOL;
//A::hello();
echo class_exists('A');
echo "" . PHP_EOL;
$oA = new A();
echo get_class($oA);
echo "" . PHP_EOL;
$oB = new B();
echo get_parent_class($oB);
echo "" . PHP_EOL;
示例3: hello
<?php
require "tests.php";
require "casts.php";
// No new functions
check::functions(array(new_a, a_hello, new_b));
// No new classes
check::classes(array(A, B));
// now new vars
check::globals(array());
# Make sure $b inherites hello() from class A
$b = new B();
$b->hello();
check::done();
示例4: hello
<?php
trait T
{
function hello()
{
echo "Hello from T!\n";
}
}
class B
{
use T;
function hello()
{
echo "Hello from B!\n";
}
}
class C extends B
{
}
class D extends C
{
}
$ob = new B();
$ob->hello();
$oc = new C();
$oc->hello();
$od = new D();
$od->hello();
示例5: A
<?php
include 'classes.php';
$a = new A();
$b = new B();
$a->hello();
echo "\n";
$b->hello(123);