<?php

namespace Scheb\Tombstone\Tracing;

class TraceProvider
{
    public static function getTraceHere(int $skipFrames = 0): array
    {
        ++$skipFrames; // Skip this call
        $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);

        return array_splice($trace, $skipFrames, 3);
    }
}

<?php

namespace Scheb\Tombstone\Tracing;

class TraceProvider
{
    public static function getTraceHere(int $skipFrames = 0): array
    {
        ++$skipFrames; // Skip this call
        $trace = (new \Exception())->getTrace();

        return array_splice($trace, $skipFrames, 3);
    }
}

Use exception to get the trace
Use exception to get the trace
