本文整理匯總了PHP中ReflectionFunction::isDeprecated方法的典型用法代碼示例。如果您正苦於以下問題:PHP ReflectionFunction::isDeprecated方法的具體用法?PHP ReflectionFunction::isDeprecated怎麽用?PHP ReflectionFunction::isDeprecated使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ReflectionFunction
的用法示例。
在下文中一共展示了ReflectionFunction::isDeprecated方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: isDeprecated
/**
* Returns whether this function is deprecated
*
* This is purely a wrapper method, which calls the corresponding method of
* the parent class.
* @return boolean
*/
public function isDeprecated()
{
// TODO: also check @deprecated annotation
if ($this->reflectionSource instanceof ReflectionFunction) {
return $this->reflectionSource->isDeprecated();
} else {
return parent::isDeprecated();
}
}
示例2: __construct
/**
* Constructor.
*
* Uses the Reflection API to get a list of deprecated functions.
*/
public function __construct()
{
$functions = get_defined_functions();
foreach ($functions['internal'] as $functionName) {
$function = new ReflectionFunction($functionName);
if ($function->isDeprecated() === true) {
$this->forbiddenFunctions[$functionName] = null;
}
}
}
示例3: ReflectionExtension
<?php
$r = new ReflectionExtension("mysql");
$ignore = array();
$functions = $r->getFunctions();
asort($functions);
printf("Functions:\n");
foreach ($functions as $func) {
if (isset($ignore[$func->name])) {
continue;
}
printf(" %s\n", $func->name);
$rf = new ReflectionFunction($func->name);
printf(" Deprecated: %s\n", $rf->isDeprecated() ? "yes" : "no");
printf(" Accepted parameters: %d\n", $rf->getNumberOfParameters());
printf(" Required parameters: %d\n", $rf->getNumberOfRequiredParameters());
foreach ($rf->getParameters() as $param) {
printf(" %s\n", $param);
}
}
print "done!";
示例4: ReflectionFunction
<?php
// We currently don't have any deprecated functions :/
$rc = new ReflectionFunction('var_dump');
var_dump($rc->isDeprecated());