本文整理汇总了PHP中C::foo方法的典型用法代码示例。如果您正苦于以下问题:PHP C::foo方法的具体用法?PHP C::foo怎么用?PHP C::foo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类C
的用法示例。
在下文中一共展示了C::foo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test
public static function test()
{
// FPushClsMethodD
C::foo("a", "b", "c", "d");
// FPushClsMethod
$cls = 'C';
$cls::foo("a", "b", "c", "d");
$fn = 'foo';
C::$fn("a", "b", "c", "d");
$fn = 'foo';
$cls::$fn("a", "b", "c", "d");
// FPushClsMethodF
self::foo("a", "b", "c", "d");
}
示例2: main
function main()
{
$c = new C();
$d = new D();
$c->foo();
$d->foo();
echo "**************\n";
$c->bar();
$d->bar();
echo "**************\n";
C::foo();
D::bar();
echo "**************\n";
$d->yar();
D::yar();
}
示例3: foo
<?php
class C
{
function foo()
{
if ($this) {
return true;
} else {
return false;
}
}
}
var_dump(C::foo());
示例4: callByParent
public static function callByParent()
{
parent::foo();
}
示例5: foo
<?php
// Copyright 2004-2015 Facebook. All Rights Reserved.
echo "Starting\n";
class C
{
public function foo()
{
echo "foo\n";
$x = array();
if ($x) {
print_r($x);
} else {
print_r($x);
}
}
}
$c = new C();
$val = $c->foo();
echo $val;
echo "\n";
echo "Done\n";
示例6: foo
<?php
trait T
{
function foo()
{
echo "Foo";
$this->bar();
}
abstract function bar();
}
class C
{
use T;
function bar()
{
echo "BAR!\n";
}
}
$x = new C();
$x->foo();
示例7: foo
{
function foo($x, $y = 0);
}
interface J
{
function foo($x, $y);
}
interface K
{
function foo($x, $y = 0, array $z);
}
interface L
{
function foo($x, $y, array $z = null);
}
interface M
{
function foo($x, $y = 0, array $z = array());
}
class C implements I, J, K, L, M
{
public function foo($x, $y = 0, array $z = null, array $a = null)
{
echo "{$x} {$y} {$z}\n";
}
}
$obj = new C();
$obj->foo(1);
$obj->foo(1, 2);
$obj->foo(1, 2, null);
$obj->foo(1, 2, array());
示例8: foo
<?php
class A
{
public $a = null;
}
class B extends A
{
public function foo()
{
var_dump($this->a);
}
}
class C extends B
{
public $a = 'test';
}
$obj = new C();
$obj->foo();
示例9: foo
<?php
// Method invocation on $this
class C
{
function foo($x, $y)
{
echo "C::foo({$x}, {$y})\n";
$this->bar($y, $x);
}
function bar($x, $y)
{
echo "C::bar({$x}, {$y})\n";
}
}
$c = new C();
$c->foo(1, 2);
示例10: doFoo
public function doFoo()
{
$this->foo();
// G G G
B::foo();
// B B (Zend: B G G) (Rule 1)
C::foo();
// C C (Zend: C G G) (Rule 1)
D::foo();
// D D (Zend: D G G) (Rule 1)
F::foo();
// F G G
G::foo();
// G G G
H::foo();
// H H (Zend: H G G) (Rule 1)
parent::foo();
// F G G
self::foo();
// G G G
static::foo();
// G G G
echo "****************\n";
}
示例11: foo
<?php
abstract class A
{
public abstract function foo(int $x);
}
interface I
{
function foo(int $x);
}
abstract class B extends A implements I
{
}
class C extends B
{
public function foo(array $x = null)
{
}
}
$c = new C();
$c->foo(null);
echo "OK\n";
示例12: bar
function bar()
{
C::foo();
}
示例13: main
function main()
{
return B::foo() + C::foo();
}
示例14: foo
<?php
class C
{
public $y = 5;
function foo($x)
{
return $x + $this->y;
}
}
$o = new C();
echo $o->foo(3) . "\n";
示例15: __call
<?php
class C
{
/**
* @param string
* @param array
*/
public function __call($method, $args)
{
}
}
$c = new C();
$c->foo('asdf');