HH\Asio\backtrace

Generates a backtrace for $awaitable.

Description

function HH\Asio\backtrace(
  Awaitable<T> $awaitable,
  int $options = DEBUG_BACKTRACE_PROVIDE_OBJECT,
  int $limit = 0,
): array<array>

Generates a backtrace for $awaitable.

Following conditions must be met to produce non-empty backtrace:

  • $awaitable has not finished yet (i.e. has_finished($awaitable) === false)
  • $awaitable is part of valid scheduler context (i.e. $awaitable->getContextIdx() > 0) If either condition is not met, backtrace() returns empty array.

Parameters

  • Awaitable<T> $awaitable - Awaitable, to take backtrace from.
  • int $options = DEBUG_BACKTRACE_PROVIDE_OBJECT - bitmask of the following options: DEBUG_BACKTRACE_PROVIDE_OBJECT DEBUG_BACKTRACE_PROVIDE_METADATA DEBUG_BACKTRACE_IGNORE_ARGS
  • int $limit = 0 - the maximum number of stack frames returned. By default (limit=0) it returns all stack frames.

Return Values

  • array - - Returns an array of associative arrays. See debug_backtrace() for detailed format description.