在线文档教程
PHP
反射 | Reflection

ReflectionFunction (class)

The ReflectionFunction class

Introduction

(PHP 5, PHP 7)

The ReflectionFunction class reports information about a function.

Class synopsis

ReflectionFunction extends ReflectionFunctionAbstract implements Reflector {

/* Constants */

const integer IS_DEPRECATED = 262144 ;

/* Properties */

public $name ;

/* Methods */

public __construct ( mixed $name )

public static string export ( string $name [, string $return ] )

public Closure getClosure ( void )

public mixed invoke ([ mixed $parameter [, mixed $... ]] )

public mixed invokeArgs ( array $args )

public bool isDisabled ( void )

public string __toString ( void )

/* Inherited methods */

final private void ReflectionFunctionAbstract::__clone ( void )

public ReflectionClass ReflectionFunctionAbstract::getClosureScopeClass ( void )

public object ReflectionFunctionAbstract::getClosureThis ( void )

public string ReflectionFunctionAbstract::getDocComment ( void )

public int ReflectionFunctionAbstract::getEndLine ( void )

public ReflectionExtension ReflectionFunctionAbstract::getExtension ( void )

public string ReflectionFunctionAbstract::getExtensionName ( void )

public string ReflectionFunctionAbstract::getFileName ( void )

public string ReflectionFunctionAbstract::getName ( void )

public string ReflectionFunctionAbstract::getNamespaceName ( void )

public int ReflectionFunctionAbstract::getNumberOfParameters ( void )

public int ReflectionFunctionAbstract::getNumberOfRequiredParameters ( void )

public array ReflectionFunctionAbstract::getParameters ( void )

public ReflectionType ReflectionFunctionAbstract::getReturnType ( void )

public string ReflectionFunctionAbstract::getShortName ( void )

public int ReflectionFunctionAbstract::getStartLine ( void )

public array ReflectionFunctionAbstract::getStaticVariables ( void )

public bool ReflectionFunctionAbstract::hasReturnType ( void )

public bool ReflectionFunctionAbstract::inNamespace ( void )

public bool ReflectionFunctionAbstract::isClosure ( void )

public bool ReflectionFunctionAbstract::isDeprecated ( void )

public bool ReflectionFunctionAbstract::isGenerator ( void )

public bool ReflectionFunctionAbstract::isInternal ( void )

public bool ReflectionFunctionAbstract::isUserDefined ( void )

public bool ReflectionFunctionAbstract::isVariadic ( void )

public bool ReflectionFunctionAbstract::returnsReference ( void )

abstract public void ReflectionFunctionAbstract::__toString ( void )

}

Properties

name

Name of the function. Read-only, throws ReflectionException in attempt to write.

Predefined Constants

ReflectionFunction Modifiers

ReflectionFunction::IS_DEPRECATED

Indicates deprecated functions.

Table of Contents

  • 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::isDisabled — Checks if function is disabled

  • ReflectionFunction::__toString — To string

← ReflectionExtension::__toString

ReflectionFunction::__construct →

© 1997–2017 The PHP Documentation Group

Licensed under the Creative Commons Attribution License v3.0 or later.

https://secure.php.net/manual/en/class.reflectionfunction.php