Hi Tyson,

wt., 21 lip 2020 o 06:54 tyson andre <tysonandre...@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ł

Reply via email to