decodelabs / remnant
Easier stack traces
Installs: 1 066
Dependents: 3
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Requires
- php: ^8.4
Requires (Dev)
- decodelabs/monarch: ^0.1.3
- decodelabs/phpstan-decodelabs: ^0.7.0
Conflicts
- decodelabs/monarch: <0.1.3
This package is auto-updated.
Last update: 2025-07-16 13:18:32 UTC
README
Easier stack traces
Remnant provides a simple way to generate more user-friendly stack traces in PHP.
Installation
Install via Composer:
composer require decodelabs/remnant
Usage
Create a trace in the current context or from an Exception:
use DecodeLabs\Remnant\Trace; $trace = Trace::create(); $exceptionTrace = Trace::fromException($exception); // Pass an integer to either method to rewind the trace by that many frames $trace = Trace::create(2); $exceptionTrace = Trace::fromException($exception, 2);
Access frames from the trace using standard array methods:
foreach ($trace as $frame) { echo $frame->file . ':' . $frame->line . ' - ' . $frame->function . PHP_EOL; } $frame = $trace[0]; // Get the first frame echo (string)$frame; // Convert frame to string for a formatted output
Licensing
Remnant is licensed under the MIT License. See LICENSE for the full license text.