本文整理匯總了PHP中D::f方法的典型用法代碼示例。如果您正苦於以下問題:PHP D::f方法的具體用法?PHP D::f怎麽用?PHP D::f使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類D
的用法示例。
在下文中一共展示了D::f方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: eval
[expect] hey!
[file]
<?php
eval('class InEval { function f() { echo "hey!"; } }');
class A extends InEval
{
}
class B extends A
{
}
class C extends B
{
}
class D extends C
{
function f()
{
return parent::f();
}
}
D::f();
示例2: f
var_dump($c2);
var_dump(isset($c2->prop));
echo "---------- unsetting \$this ------------\n";
class D
{
public function f()
{
echo "Inside " . __METHOD__ . "\n";
var_dump(isset($this));
unset($this);
var_dump(isset($this));
$this->g();
// use $this to call sibling instance method
}
private function g()
{
echo "Inside " . __METHOD__ . "\n";
var_dump(isset($this));
}
}
$d = new D();
$d->f();
echo "---------- unsetting array elements ------------\n";
$a = array(10, 20, "xx" => 30);
print_r($a);
unset($a[1]);
print_r($a);
unset($a[10]);
print_r($a);
unset($a["Xx"]);
print_r($a);
示例3: var_dump
//find user in table
//test if there is at least one such user
$row = Data::getRow("SELECT {$prfx}user.*, {$prfx}contest.settings\r\n FROM {$prfx}session\r\n INNER JOIN {$prfx}user\r\n ON {$prfx}session.user_id={$prfx}user.id\r\n INNER JOIN {$prfx}contest\r\n ON {$prfx}user.contest_id={$prfx}contest.id\r\n WHERE session_id='{$session_id}'");
//test if there is at least one user
var_dump($row);
die;
class D
{
private static $c = 42;
static function f()
{
return D::$c;
}
}
//var_dump(D::$c);
var_dump(D::f());
$s = false;
if ($s === false) {
die('false');
} else {
die('true');
}
die;
$a = array();
var_dump($a[1]);
var_dump(ZIPARCHIVE::ER_EXISTS);
var_dump(ZIPARCHIVE::ER_INCONS);
var_dump(ZIPARCHIVE::ER_INVAL);
var_dump(ZIPARCHIVE::ER_MEMORY);
var_dump(ZIPARCHIVE::ER_NOENT);
var_dump(ZIPARCHIVE::ER_NOZIP);