Re: Re: [RFC][DISCUSSION] debug_backtrace alternative as an array of StackFrame objects
| From: | Michał Marcin Brzuchalski | Date: | Tue, 21 Jul 2020 05:02:14 +0000 |
| Subject: | Re: Re: [RFC][DISCUSSION] debug_backtrace alternative as an array of StackFrame objects | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-111085@lists.php.net to get a copy of this message | ||
Hi Tyson,
wt., 21 lip 2020 o 06:54 tyson andre <tysonandre775@hotmail.com> napisał(a):
> Hi Michał Marcin Brzuchalski,
>
> At the time of writing, the documentation in
> https://wiki.php.net/rfc/stack-frame-class#stackframe_class is
> also
> inconsistent with the implementation.
>
public readonly string $file; is not actually read only in the
> implementation in the GitHub PR. It can be overwritten or deleted with
> $frame->file = 'newfile.php';
> or unset($frame->file);.
> I'd guess this is expressing the desired way that StackFrame instances
> would be used by PHP code,
> but that seems confusing because some properties of other internal classes
> are actually effectively read only due to providing magic getter APIs.
> (Also see my previous comment about ArrayAccess inconsistencies)
> Dropping the readonly from the RFC is one possible way to clarify that.
>
The readonly was dropped in the RFC to meet the implementation similar to
PhpToken where a developer is free to modify all properties.
Cheers,
Michał