本文整理汇总了PHP中M::psf方法的典型用法代码示例。如果您正苦于以下问题:PHP M::psf方法的具体用法?PHP M::psf怎么用?PHP M::psf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类M
的用法示例。
在下文中一共展示了M::psf方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: b2
echo "psProp = " . parent::$psProp . "\n";
echo "MYPI = " . parent::MYPI . "\n";
}
public function b2()
{
echo "Inside " . __METHOD__ . "\n";
}
// The following 3 members override those in class M
public static function psf()
{
return 123;
}
public static $psProp = 999;
const MYPI = 3.14159;
}
var_dump(M::psf());
// okay to access static method via class
$memName = 'psf';
var_dump(M::$memName());
// string form allowed
//var_dump(M::'psf'()); // but not string literal
var_dump(M::$psProp);
// okay to access static property via class, but leading $ needed!!
$memName = '$psProp';
//var_dump(M::$memName);// Access to undeclared static property: M::$memName
//var_dump(M::memName);// Undefined class constant 'memName'
var_dump(M::MYPI);
// okay to access const via class
$memName = 'MYPI';
//var_dump(M::$memName); // Access to undeclared static property: M::$memName
$clName = "M";