本文整理汇总了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());