abstract class ReflectionFunctionAbstract implements Reflector (View source)

A parent class to ReflectionFunction, read its description for details.

Properties

string $name

Methods

bool
inNamespace()

Checks if function in namespace

bool
isClosure()

Checks if closure

bool
isDeprecated()

Checks if deprecated

bool
isInternal()

Checks if is internal

bool
isUserDefined()

Checks if user defined

bool
isGenerator()

Returns whether this function is a generator

bool
isVariadic()

Returns whether this function is variadic

object|null
getClosureThis()

Returns this pointer bound to closure

getClosureScopeClass()

Returns the scope associated to the closure

getClosureCalledClass()

No description

string|false
getDocComment()

Gets doc comment

int|false
getEndLine()

Gets end line number

getExtension()

Gets extension info

string|false
getExtensionName()

Gets extension name

string|false
getFileName()

Gets file name

string
getName()

Gets function name

string
getNamespaceName()

Gets namespace name

int
getNumberOfParameters()

Gets number of parameters

int
getNumberOfRequiredParameters()

Gets number of required parameters

array
getParameters()

Gets parameters

getReturnType()

Gets the specified return type of a function

string
getShortName()

Gets function short name

int|false
getStartLine()

Gets starting line number

array
getStaticVariables()

Gets static variables

bool
returnsReference()

Checks if returns reference

bool
hasReturnType()

Checks if the function has a specified return type

array
getAttributes(string|null $name = null, int $flags = 0)

No description

array
getClosureUsedVariables()

No description

bool
hasTentativeReturnType()

No description

getTentativeReturnType()

No description

bool
isStatic()

No description

string
__toString()

Returns the string representation of any Reflection object.

Details

bool inNamespace()

Checks if function in namespace

Return Value

bool

{\true} if it's in a namespace, otherwise {\false}

bool isClosure()

Checks if closure

Return Value

bool

{\true} if it's a closure, otherwise {\false}

bool isDeprecated()

Checks if deprecated

Return Value

bool

{\true} if it's deprecated, otherwise {\false}

bool isInternal()

Checks if is internal

Return Value

bool

{\true} if it's internal, otherwise {\false}

bool isUserDefined()

Checks if user defined

Return Value

bool

{\true} if it's user-defined, otherwise {\false}

bool isGenerator()

Since: 5.5

Returns whether this function is a generator

Return Value

bool

{\true} if the function is generator, otherwise {\false}

bool isVariadic()

Since: 5.6

Returns whether this function is variadic

Return Value

bool

{\true} if the function is variadic, otherwise {\false}

object|null getClosureThis()

Returns this pointer bound to closure

Return Value

object|null

Returns $this pointer or {\null} in case of an error.

ReflectionClass|null getClosureScopeClass()

Since: 5.4

Returns the scope associated to the closure

Return Value

ReflectionClass|null

Returns the class on success or {\null} on failure.

ReflectionClass|null getClosureCalledClass()

Since: 8.0

No description

Return Value

ReflectionClass|null

Returns the class on success or {\null} on failure.

string|false getDocComment()

Gets doc comment

Return Value

string|false

The doc comment if it exists, otherwise {\false}

int|false getEndLine()

Gets end line number

Return Value

int|false

The ending line number of the user defined function, or {\false} if unknown.

ReflectionExtension|null getExtension()

Gets extension info

Return Value

ReflectionExtension|null

The extension information, as a {\ReflectionExtension} object or {\null} instead.

string|false getExtensionName()

Gets extension name

Return Value

string|false

The extension's name or {\false} instead.

string|false getFileName()

Gets file name

Return Value

string|false

The file name or {\false} in case of error.

string getName()

Gets function name

Return Value

string

The name of the function.

string getNamespaceName()

Gets namespace name

Return Value

string

The namespace name.

int getNumberOfParameters()

Since: 5.0.3

Gets number of parameters

Return Value

int

The number of parameters.

int getNumberOfRequiredParameters()

Since: 5.0.3

Gets number of required parameters

Return Value

int

The number of required parameters.

array getParameters()

Gets parameters

Return Value

array

The parameters, as a ReflectionParameter objects.

ReflectionType|null getReturnType()

Since: 7.0

Gets the specified return type of a function

Return Value

ReflectionType|null

Returns a {\ReflectionType} object if a return type is specified, {\null} otherwise.

string getShortName()

Gets function short name

Return Value

string

The short name of the function.

int|false getStartLine()

Gets starting line number

Return Value

int|false

The starting line number or {\false} if unknown.

array getStaticVariables()

Gets static variables

Return Value

array

An array of static variables.

bool returnsReference()

Checks if returns reference

Return Value

bool

{\true} if it returns a reference, otherwise {\false}

bool hasReturnType()

Since: 7.0

Checks if the function has a specified return type

Return Value

bool

Returns {\true} if the function is a specified return type, otherwise {\false}.

array getAttributes(string|null $name = null, int $flags = 0)

Since: 8.0

No description

Parameters

string|null $name

Name of an attribute class

int $flags

Сriteria by which the attribute is searched.

Return Value

array

array getClosureUsedVariables()

No description

Return Value

array

bool hasTentativeReturnType()

No description

Return Value

bool

ReflectionType|null getTentativeReturnType()

No description

Return Value

ReflectionType|null

bool isStatic()

No description

Return Value

bool

string __toString()

Returns the string representation of any Reflection object.

Please note that since PHP 8.0 this method is absent in this interface and inherits from the {\Stringable} parent.

Return Value

string

Returns string representation of the object that implements this interface (and/or "__toString" magic method).