Re: [RFC][DISCUSSION] debug_backtrace alternative as an array of StackFrame objects
| From: | Michał Marcin Brzuchalski | Date: | Thu, 09 Jul 2020 07:05:24 +0000 |
| Subject: | Re: [RFC][DISCUSSION] debug_backtrace alternative as an array of StackFrame objects | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-110886@lists.php.net to get a copy of this message | ||
Hi Levi,
śr., 8 lip 2020 o 22:25 Levi Morrison <levi.morrison@datadoghq.com>
napisał(a):
> Any opposition for a parameter to limit stack depth? It's something
> I'd like on the old API too.
>
I've updated the RFC with the same arguments as in
debug_backtrace()
function.
I'm also considering adding a third option for int $offset = 0 in some
known cases
we want by default skip more frames at the beginning when they're known
this would
reduce copying values from skipped frames.
I've also added two additional properties and related methods:
1) property ?string $object_class = null and method `public function
getObjectClass(): ?string`
They expose an object class name which is useful in case we don't wanna
populate frames with the objects.
The additional information could fulfil the
https://bugs.php.net/bug.php?id=45351 if frames
as objects
would be got accepted as a replacement in Exception::getTrace().
2) property ?\Closure $closure = null and method `public function
getClosure(): ?\Closure`
They expose a closure which is useful in case the frame was produced by
closure call.
This was added to keep the function property compatibility with frames
produced by debug_backtrace().
The additional information could fulfil the
https://bugs.php.net/bug.php?id=62325 if frames
as objects
would be got accepted as a replacement in Exception::getTrace().
Cheers,
--
Michał Marcin Brzuchalski