本文整理汇总了PHP中A::foo方法的典型用法代码示例。如果您正苦于以下问题:PHP A::foo方法的具体用法?PHP A::foo怎么用?PHP A::foo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类A
的用法示例。
在下文中一共展示了A::foo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foo
function foo()
{
$a = new A();
$a->foo();
$a->field = 123;
$a->foo();
}
示例2: bar
function bar()
{
$obj = new A();
$obj->foo(123);
$obj = new B();
$obj->foo(123, 456);
}
示例3: foo3
public function foo3()
{
$this->foo();
// $this changes 'static'
parent::foo();
// 'parent' doesn't change 'static'
}
示例4: foo
function foo()
{
$a = new A();
$a->foo();
$a->bar();
# $a->baz();
}
示例5: bar
function bar()
{
$obj = new A();
$obj->foo();
$obj = new B();
$obj->foo();
}
示例6: array
static function __callstatic($name, $args)
{
parent::__callstatic($name, $args);
call_user_func_array("parent::__callstatic", array($name, $args));
parent::foo();
call_user_func_array("parent::foo", $args);
call_user_func_array(array("parent", "foo"), $args);
}
示例7: test
function test()
{
$a = new A();
echo $a->foo();
$a = new B();
echo $a->foo(555);
echo $a->foo();
}
示例8: test
public static function test()
{
A::foo();
// non-forwarding call, A::foo
self::foo();
// forwarding call, C::foo
parent::foo();
// forwarding call, C::foo
}
示例9: foo
public function foo()
{
$a = new A();
$a->foo();
$b = new Boo();
$b->foo();
$c = new Clo();
$c->foo();
}
示例10: doFoo
public function doFoo()
{
$this->foo();
// B B B
B::foo();
// B B B
C::foo();
// C C (Zend outputs: C B B) (Rule 1)
D::foo();
// D D (Zend outputs: D B B) (Rule 1)
F::foo();
// F F (Zend outputs: F B B) (Rule 1)
G::foo();
// G G (Zend outputs: G B B) (Rule 1)
H::foo();
// H H (Zend outputs: H B B) (Rule 1)
parent::foo();
// A B B
self::foo();
// B B B
static::foo();
// B B B
echo "****************\n";
}
示例11: foo
<?php
// Make sure that we can tell which class was called for intercepted static
// methods
class A
{
public function foo()
{
echo 'foo called';
}
}
class B extends A
{
}
fb_intercept('A::foo', function ($_, $called_on) {
var_dump($called_on);
});
A::foo();
B::foo();
// Trigger run_intercept_handler_for_invokefunc codepath
$class = 'B';
$c = 'call_user_fun';
$c .= 'c';
$c(array($class, 'foo'));
示例12: foo
<?php
class A
{
private $a = 0;
protected $b = 0;
public $c = 0;
function foo()
{
var_dump($this->a, $this->b, $this->c);
}
function bar()
{
echo __METHOD__ . "\n";
var_dump($this->a, $this->b, $this->c);
}
}
class B extends A
{
public $a = 1;
public $b = 1;
public $c = 1;
function foo()
{
var_dump($this->a, $this->b, $this->c);
}
}
$x = new A();
$x->foo();
$x = new B();
$x->foo();
$x->bar();
示例13: foo
<?php
class A
{
static function foo()
{
return function () {
};
}
}
$a = A::foo();
$a->bindTo(new A());
echo "Done.\n";
示例14: foo
<?php
$a = 1;
if (empty(foo($a))) {
}
if (empty($a->foo($a))) {
}
if (empty($foo($a))) {
}
if (empty(A::foo($a))) {
}
if (empty($a)) {
}
if (empty(array())) {
}
if (empty([''])) {
}
if (empty(${a})) {
}
function foo($a)
{
return true;
}
示例15: A
<?php
// including scripts example
include "a.php";
require_once "b.php";
f(12345);
$a = new A("AAA");
$a->write();
$a->foo("hello");
$a->write();
$b = new B("BBB");
$b->write();
$b->foo("bye");
$b->write();
fgets(STDIN);