Stackdriver Debugger Client - Class StackFrame (1.6.4)

Reference documentation and code samples for the Stackdriver Debugger Client class StackFrame.

Represents a stack frame context.

Example:

use Google\Cloud\Debugger\SourceLocation;
use Google\Cloud\Debugger\StackFrame;

$location = new SourceLocation('/path/to/file.php', 10);
$stackFrame = new StackFrame('function-name', $location);

Namespace

Google \ Cloud \ Debugger

Methods

__construct

Instantiate a new StackFrame.

Parameters
NameDescription
function string

Demangled function name at the call site.

location Google\Cloud\Debugger\SourceLocation

The source location

addLocal

Register a local variable in this stack frame.

Example:

$stackFrame->addLocal($variable);
Parameter
NameDescription
variable Google\Cloud\Debugger\Variable

locals

Returns the captured locals for this stack frame.

Example:

$locals = $stackFrame->locals();
Returns
TypeDescription
array<Google\Cloud\Debugger\Variable>

info

Return a serializable version of this object

Returns
TypeDescription
array

static::fromJson

Instantiate a new StackFrame from JSON form

Example:

$stackFrame = StackFrame::fromJson([
    'function' => 'function-name',
    'location' => [
        'path' => '/path/to/file.php',
        'line' => 10
    ]
]);
Parameters
NameDescription
data array

{ @type string $function Demangled function name at the call site. @type SourceLocation $location The source location }

↳ function string

Demangled function name at the call site.

↳ location SourceLocation

The source location

Returns
TypeDescription
Google\Cloud\Debugger\StackFrame