本文整理汇总了PHP中A::f方法的典型用法代码示例。如果您正苦于以下问题:PHP A::f方法的具体用法?PHP A::f怎么用?PHP A::f使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类A
的用法示例。
在下文中一共展示了A::f方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
parent::A();
// NOK
parent::f();
// OK
}
示例2: main
function main()
{
$a = new A();
$a->foo = 12;
$a->f();
inOtherUnit(1, 2);
}
示例3: g
$x =& $z;
return $x;
}
public function g()
{
global $z;
$x =& $z;
return $x;
}
}
function f()
{
global $z;
$x =& $z;
return $x;
}
function g(&$x)
{
$x[] = 1;
}
$z = array(1);
$a = new A();
g(f());
__var_dump($z);
g(A::f());
__var_dump($z);
$g = "g";
$g(A::f());
__var_dump($z);
g($a->g());
__var_dump($z);
示例4: f
<?php
class A
{
function f() : int
{
return 42;
}
}
class B
{
function g() : string
{
return 'string';
}
}
$a = new A();
print $a->g();
print $a->f();
$a = new B();
print $a->g();
print $a->f();
示例5: f
<?php
class A
{
public function f($x)
{
var_dump($x());
var_dump(get_class());
}
}
$a = new A();
$a->f('get_class');
var_dump(get_class($a));
var_dump(get_class());
var_dump(get_class(null));
示例6: array
[expect php]
[file]
<?php
$a = array("");
$a[0][0] = "f";
var_dump($a);
$a = array("bubu");
@($a[0][0] = "xyz");
var_dump($a);
class C
{
public $f;
}
$c = new C();
$c->f = "kuku";
$c->f[2] = "x";
var_dump($c);
class B
{
static $f;
}
B::$f = "hello";
B::$f[3] = "x";
var_dump(B::$f);
eval('class A { static $f; }');
A::$f = "hello";
A::$f[3] = "x";
var_dump(A::$f);
示例7: a
}
}
interface I
{
public function a(int $a1 = 0);
public function b(array $b1 = null);
}
class B implements I
{
public function a(int $a1 = null, int $z1 = 1, int $z2 = D2, int $z3 = 3, int $z4 = null)
{
}
public function b(array $b1 = null, array $y = array(), int $z1 = 1, int $z2 = 2, double $z3 = 3.0, string $z4 = "abc")
{
}
}
$a = new A();
$a->a();
$a->b();
$a->d();
$a->f();
$a->i();
$a->s();
$a->c();
$a->c($a);
$a->c(null);
$a->z();
$b = new B();
$b->a();
$b->b();
print "Pass\n";
示例8: f
<?php
// This test validates phan checking the types of params passed to assert()
class A
{
public static function f() : bool
{
return false;
}
}
assert(!A::f(), 'string');
assert(10 > 1, 'string');
示例9: f
[EXPECT] g
[FILE]
<?php
class A
{
static function f()
{
function v()
{
class B
{
static function g()
{
echo __FUNCTION__;
}
}
B::g();
}
v();
}
}
A::f();
示例10: f
<?php
class A
{
function f($a)
{
}
}
$obj = new A();
$obj->f(date('m/d/y H:i:s', 123456789));
$v = date("m", 123456789) + 1;
示例11: f
<?php
class A
{
function f($a)
{
var_dump($a === null);
}
}
$a = true;
$a = new A();
$a->f(array());
示例12: f
<?php
class A
{
static function f()
{
return new static();
}
static function g($o)
{
return $o instanceof static;
}
}
class B extends A
{
}
var_dump(A::g(A::f()));
var_dump(A::g(B::f()));
var_dump(B::g(A::f()));
var_dump(B::g(B::f()));
示例13: test
function test()
{
$a = new A();
$a->f();
var_dump($a);
}
示例14: f
<?php
if (class_exists('B')) {
class A extends B
{
public function f()
{
var_dump('A');
}
}
}
var_dump(class_exists('C'));
class B extends C
{
public function f()
{
var_dump('B');
}
}
class C
{
}
if (class_exists('A')) {
$obj = new A();
$obj->f();
} else {
var_dump('correct');
}
示例15: f
<?php
$a = 'self';
class A
{
public static function f($value)
{
$filter = 'g';
return call_user_func(array($GLOBALS['a'], $filter), $value);
}
public static function g($value)
{
return $value;
}
}
var_dump(A::f('test'));