本文整理汇总了PHP中C::f方法的典型用法代码示例。如果您正苦于以下问题:PHP C::f方法的具体用法?PHP C::f怎么用?PHP C::f使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类C
的用法示例。
在下文中一共展示了C::f方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: f
function f()
{
A1::f();
A2::f();
\A1::f();
\A2::f();
B::f();
C::f();
}
示例2: main
function main()
{
print "C::k : " . C::k . "\n";
$X = "C";
print "{$X}::k : " . $X::k . "\n";
# XXX Exit here to avoid unimplemented HHBC instructions.
exit(0);
C::sf();
# XXX Need SProp replacement.
#print "C::\$s : ".C::$s."\n";
#print "\$X::\$s : ".$X::$s."\n";
$c = new C();
print "\$c->p : " . $c->p . "\n";
$c->f(43);
var_dump($c);
print "Test end\n";
}
示例4: f
<?php
class C
{
public static function f($foo, $whatever)
{
}
}
function g($bar)
{
}
function h()
{
return GLOBAL_FOO;
}
class D
{
public static function foo($x, $y)
{
return $x->map(function ($i) use($y) {
return $y[$i];
});
}
}
C::f(null, null);
g(null);
示例5: array
<?php
class C
{
function __call($name, $values)
{
$values[0][0] = 'changed';
}
}
$a = array('original');
$b = array('original');
$hack =& $b[0];
$c = new C();
$c->f($a);
$c->f($b);
var_dump($a, $b);
示例7: f
<?php
require_once $GLOBALS['HACKLIB_ROOT'];
class C
{
public static function f($foo, $whatever)
{
$x = (int) (5.3 + 2.8) + 20;
echo $x;
}
}
class D
{
public static function foo($x, $y)
{
return $x->map(function ($i) use($y) {
return $y[$i];
});
}
}
C::f(array(), null);
示例8: f
<?php
class C
{
function f($x)
{
return $x *= 2;
}
}
$o = new C();
echo $o->f(17);
$mockedF = 'function($x){
return $x ** 2;
}';
/*
$o2 = new class extends C {
function f($x){
return (function($x){
return $x ** 2;
})($x);
}
};
*/
$code = <<<code
\t\$o2 = new class extends C {
\t\tfunction f(\$x){
\t\t\treturn ({$mockedF})(\$x);
\t\t}
\t};
code;
eval($code);
示例9: f
<?php
class C extends A implements I
{
use T;
function f()
{
}
}
abstract class A
{
}
interface I
{
}
trait T
{
}
$v = new C();
$v->f();
示例10: f
}
abstract class D implements FooBar, Boo
{
}
class C extends D
{
public function f()
{
echo "f\n";
}
public function b()
{
echo "b\n";
}
public function fb()
{
echo "fb\n";
}
public function o()
{
echo "o\n";
}
}
$c = new C();
$c->f();
$c->b();
$c->fb();
$c->o();
echo Foo::x . "\n";
echo FooBar::x . "\n";
echo C::x . "\n";
示例11: f
class C
{
/**
* @return self
*/
function f()
{
return $this;
}
/**
* @return static
*/
function g()
{
return $this;
}
/**
* @return $this
*/
function h()
{
return $this;
}
function test(C $c)
{
}
}
$c = new C();
$f = $c->test($c->f());
$g = $c->test($c->g());
$h = $c->test($c->h());
示例12: f
<?php
class C
{
const FOO = 1;
private static $bar = 2;
public static function f()
{
eval(<<<'PHP'
var_dump(self::FOO);
var_dump(self::$bar);
var_dump(self::class);
var_dump(static::class);
PHP
);
}
}
C::f();
示例13: g
<?php
class C
{
function g()
{
$ex = new Exception();
$bt = $ex->getTrace();
foreach ($bt as $k => $_) {
$frame = $bt[$k];
unset($frame['file']);
unset($frame['line']);
unset($frame['args']);
ksort($frame);
$bt[$k] = $frame;
}
var_dump($bt);
}
function f()
{
$this->g();
}
}
$obj = new C();
$obj->f();
echo "------------------------\n";
Exception::setTraceOptions(DEBUG_BACKTRACE_PROVIDE_OBJECT);
$obj->f();
示例14: f
<?php
class C
{
const X = 1;
static function f()
{
return new C();
}
}
var_dump(C::f()::X);
var_dump(C::{'f' . ''}()::X);
示例15: f
<?php
class C
{
private $x = 42;
public function f() : int
{
return $this->x;
}
}
$v = C::f();