# ReflectionFunction 类

(PHP 5, PHP 7, PHP 8)

## 简介

ReflectionFunction 类报告有关函数的信息。

## 类摘要

class ReflectionFunction extends ReflectionFunctionAbstract {
/* 常量 */
public const int IS_DEPRECATED;
/* 继承的属性 */
public string $name;
/* 方法 */
public function __construct(Closure|string `$function`)
public static function export(string `$name`, string `$return` = ?): string
public function getClosure(): Closure
public function invoke(mixed `...$args`): mixed
public function invokeArgs(array `$args`): mixed
public function isAnonymous(): bool
#[\Deprecated]
public function isDisabled(): bool
public function __toString(): string
/* 继承的方法 */
private function ReflectionFunctionAbstract::__clone(): void
public function ReflectionFunctionAbstract::getAttributes(?string `$name` = null, int `$flags` = 0): array
public function ReflectionFunctionAbstract::getClosureCalledClass(): ?ReflectionClass
public function ReflectionFunctionAbstract::getClosureScopeClass(): ?ReflectionClass
public function ReflectionFunctionAbstract::getClosureThis(): ?object
public function ReflectionFunctionAbstract::getClosureUsedVariables(): array
public function ReflectionFunctionAbstract::getDocComment(): string|false
public function ReflectionFunctionAbstract::getEndLine(): int|false
public function ReflectionFunctionAbstract::getExtension(): ?ReflectionExtension
public function ReflectionFunctionAbstract::getExtensionName(): string|false
public function ReflectionFunctionAbstract::getFileName(): string|false
public function ReflectionFunctionAbstract::getName(): string
public function ReflectionFunctionAbstract::getNamespaceName(): string
public function ReflectionFunctionAbstract::getNumberOfParameters(): int
public function ReflectionFunctionAbstract::getNumberOfRequiredParameters(): int
public function ReflectionFunctionAbstract::getParameters(): array
public function ReflectionFunctionAbstract::getReturnType(): ?ReflectionType
public function ReflectionFunctionAbstract::getShortName(): string
public function ReflectionFunctionAbstract::getStartLine(): int|false
public function ReflectionFunctionAbstract::getStaticVariables(): array
public function ReflectionFunctionAbstract::getTentativeReturnType(): ?ReflectionType
public function ReflectionFunctionAbstract::hasReturnType(): bool
public function ReflectionFunctionAbstract::hasTentativeReturnType(): bool
public function ReflectionFunctionAbstract::inNamespace(): bool
public function ReflectionFunctionAbstract::isClosure(): bool
public function ReflectionFunctionAbstract::isDeprecated(): bool
public function ReflectionFunctionAbstract::isGenerator(): bool
public function ReflectionFunctionAbstract::isInternal(): bool
public function ReflectionFunctionAbstract::isStatic(): bool
public function ReflectionFunctionAbstract::isUserDefined(): bool
public function ReflectionFunctionAbstract::isVariadic(): bool
public function ReflectionFunctionAbstract::returnsReference(): bool
abstract public function ReflectionFunctionAbstract::__toString(): void
}

## 预定义常量

## ReflectionFunction 修饰符

ReflectionFunction::IS_DEPRECATED int

  表示弃用函数。

## 更新日志

版本 | 说明
--- | ---
8.4.0 | 所有类常量现已类型化。
8.0.0 | 已移除 ReflectionFunction::export()。

## 目录

- ReflectionFunction::__construct — Constructs a ReflectionFunction object
- ReflectionFunction::export — Exports function
- ReflectionFunction::getClosure — Returns a dynamically created closure for the function
- ReflectionFunction::invoke — Invokes function
- ReflectionFunction::invokeArgs — Invokes function args
- ReflectionFunction::isAnonymous — Checks if a function is anonymous
- ReflectionFunction::isDisabled — Checks if function is disabled
- ReflectionFunction::__toString — Returns the string representation of the ReflectionFunction object

`↑` and `↓` to navigate • `Enter` to select • `Esc` to close • `/` to open