# SnapshotComparison

> Pairs request-summary metrics with per-panel structural differences for two captured snapshots.

[API reference](/docs/api/index.md) › [Debug Core](/docs/extensions/debug-core/reference/index.md) › [Comparison](/docs/extensions/debug-core/reference/comparison/index.md) › SnapshotComparison

| final readonly class | `PHPForge\Debug\Comparison\SnapshotComparison` |
| --- | --- |
| Source | [`src/Comparison/SnapshotComparison.php`](https://github.com/php-forge/debug-core/blob/main/src/Comparison/SnapshotComparison.php#L12) |

Pairs request-summary metrics with per-panel structural differences for two captured snapshots.

## Properties

| Property | Type | Description | Defined by |
| --- | --- | --- | --- |
| <span id="property-baseline"></span>`$baseline` readonly constructor | [`PHPForge\Debug\Storage\DebugSnapshot`](/docs/extensions/debug-core/reference/storage/debugsnapshot/index.md) | Baseline snapshot. | `SnapshotComparison` |
| <span id="property-metrics"></span>`$metrics` readonly constructor | `list<`[`SummaryMetricComparison`](/docs/extensions/debug-core/reference/comparison/summarymetriccomparison/index.md)`>` | Summary metric comparisons in canonical history order. | `SnapshotComparison` |
| <span id="property-panels"></span>`$panels` readonly constructor | `list<`[`PanelComparison`](/docs/extensions/debug-core/reference/comparison/panelcomparison/index.md)`>` | Panel comparisons in configured display order. | `SnapshotComparison` |
| <span id="property-target"></span>`$target` readonly constructor | [`PHPForge\Debug\Storage\DebugSnapshot`](/docs/extensions/debug-core/reference/storage/debugsnapshot/index.md) | Target snapshot. | `SnapshotComparison` |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`between()`](#method-between) static | Compares two snapshots, combining summary metrics with panel structural differences. | `SnapshotComparison` |
| [`hasDifferences()`](#method-hasDifferences) | Returns whether any summary metric or panel payload differs. | `SnapshotComparison` |

## Method details

### between() <span id="method-between"></span>

```php
public static function between(PHPForge\Debug\Storage\DebugSnapshot $baseline, PHPForge\Debug\Storage\DebugSnapshot $target, array<string, string> $panelLabels = []): self
```

Compares two snapshots, combining summary metrics with panel structural differences.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$baseline` | [`PHPForge\Debug\Storage\DebugSnapshot`](/docs/extensions/debug-core/reference/storage/debugsnapshot/index.md) | Baseline snapshot. |
| `$target` | [`PHPForge\Debug\Storage\DebugSnapshot`](/docs/extensions/debug-core/reference/storage/debugsnapshot/index.md) | Target snapshot. |
| `$panelLabels` | `array<string, string>` | Display names indexed by stable panel ID, in display order. |

**Returns**

`self`: Comparison pairing summary metrics with per-panel structural differences.

### hasDifferences() <span id="method-hasDifferences"></span>

```php
public function hasDifferences(): bool
```

Returns whether any summary metric or panel payload differs.

**Returns**

`bool`: `true` when at least one metric or panel differs; `false` otherwise.