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 \ DebuggerMethods
__construct
Instantiate a new StackFrame.
Parameters | |
---|---|
Name | Description |
function |
string
Demangled function name at the call site. |
location |
SourceLocation
The source location |
addLocal
Register a local variable in this stack frame.
Example:
$stackFrame->addLocal($variable);
Parameter | |
---|---|
Name | Description |
variable |
Variable
|
locals
Returns the captured locals for this stack frame.
Example:
$locals = $stackFrame->locals();
Returns | |
---|---|
Type | Description |
array<Variable> |
info
Return a serializable version of this object
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
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 | |
---|---|
Type | Description |
StackFrame |