Skip to content
PHP Ecosystem
Explore

TimelineSnapshot

API reference › Debug Core › Panel › Timeline › TimelineSnapshot

final readonly classPHPForge\Debug\Panel\Timeline\TimelineSnapshot
ImplementsPHPForge\Debug\Storage\PanelSnapshot
Sourcesrc/Panel/Timeline/TimelineSnapshot.php

Canonical timing and peak-memory snapshot for the Timeline panel.

PropertyTypeDescriptionDefined by
$end readonly constructorfloatThe end time of the timeline snapshot.TimelineSnapshot
$memory readonly constructorintThe peak memory usage at the time of the snapshot.TimelineSnapshot
$start readonly constructorfloatThe start time of the timeline snapshot.TimelineSnapshot
MethodDescriptionDefined by
__construct()Creates the timing and peak-memory snapshot for the request.TimelineSnapshot
fromArray() staticHydrates the Timeline panel snapshot from decoded JSON data.TimelineSnapshot
jsonSerialize()Returns the snapshot for JSON serialization.TimelineSnapshot
public function __construct(float $start, float $end, int $memory)

Creates the timing and peak-memory snapshot for the request.

Parameters

ParameterTypeDescription
$startfloatThe start time of the timeline snapshot.
$endfloatThe end time of the timeline snapshot.
$memoryintThe peak memory usage at the time of the snapshot.
public static function fromArray(mixed $data, string $path): self

Hydrates the Timeline panel snapshot from decoded JSON data.

Parameters

ParameterTypeDescription
$datamixedDecoded Timeline panel payload.
$pathstringPayload path used in hydration errors.

Returns

self: Hydrated timing and peak-memory snapshot.

public function jsonSerialize(): array<string, mixed>

Returns the snapshot for JSON serialization.

Returns

array<string, mixed>: Serialized start time, end time, and peak memory.