Since: 8.1

final class ReflectionFiber (View source)

Methods

__construct(Fiber $fiber)

Constructs a ReflectionFiber object

getFiber()

Get the reflected Fiber instance

string|null
getExecutingFile()

Get the file name of the current execution point

int|null
getExecutingLine()

Get the line number of the current execution point

callable
getCallable()

Gets the callable used to create the Fiber

array
getTrace(int $options = DEBUG_BACKTRACE_PROVIDE_OBJECT)

Get the backtrace of the current execution point

Details

__construct(Fiber $fiber)

Constructs a ReflectionFiber object

Parameters

Fiber $fiber

The Fiber to reflect.

Fiber getFiber()

Get the reflected Fiber instance

Returns the Fiber instance being reflected.

Return Value

Fiber

The Fiber instance being reflected.

string|null getExecutingFile()

Get the file name of the current execution point

Returns the full path and file name of the current execution point in the reflected Fiber. If the fiber has not been started or has terminated, an Error is thrown.

Return Value

string|null

The full path and file name of the reflected fiber. If the reflected fiber is used outside a user-defined function, null is returned.

int|null getExecutingLine()

Get the line number of the current execution point

Returns the line number of the current execution point in the reflected Fiber. If the reflected fiber is used outside a user-defined function, null is returned. If the fiber has not been started or has terminated, an Error is thrown.

Return Value

int|null

The line number of the current execution point in the fiber.

callable getCallable()

Gets the callable used to create the Fiber

Returns the callable used to construct the Fiber. If the fiber has terminated, an Error is thrown.

Return Value

callable

The callable used to create the Fiber.

array getTrace(int $options = DEBUG_BACKTRACE_PROVIDE_OBJECT)

Get the backtrace of the current execution point

Get the backtrace of the current execution point in the reflected Fiber.

Parameters

int $options

The value of options can be any of the following flags. Available options Option Description DEBUG_BACKTRACE_PROVIDE_OBJECT Default. DEBUG_BACKTRACE_IGNORE_ARGS Don't include the argument information for functions in the stack trace.

Return Value

array

The backtrace of the current execution point in the fiber.