query_history
Retrieve historical values of PHP variables from previous execution steps to track changes over time without re-running the debug session.
Instructions
Query past variable values from the session recorder (time-travel debugging).
WHEN TO USE:
To see how a variable changed over execution steps
To compare values between steps without re-running
To understand state progression leading to a bug
DOES NOT REQUIRE PAUSED STATE - can query history anytime during an active session.
RETURNS: Array of historical values with step numbers and timestamps, showing how the variable changed over time.
LIMITATION: Only variables that were inspected via inspect_variable are recorded. If you didn't inspect a variable at a step, it won't have history for that step.
EXAMPLE USAGE: "What was $user->status 3 steps ago?" query_history("$user->status", steps_ago=3)
"Show me the last 10 values of $total" query_history("$total", limit=10)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of history entries to return. Useful for seeing variable progression over time. | |
| steps_ago | No | How many steps back to look. 0 = current step, 1 = previous step, 2 = two steps ago, etc. | |
| variable_name | Yes | PHP variable name to query history for. Example: '$user', '$status', '$order->total' |