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.

```
final class StackFrame implements ArrayAccess
{
    public readonly string $file;
 
    public readonly int $line;
 ```

The first time I've compiled or looked at the implementation and RFC document 
in detail was this evening, out of a curiosity of how it worked
and to look into the performance impact to expect,
after seeing the vote announcement this morning.

> Sorry for the late comment - I'd been busy/occupied with various other things 
> and this RFC fell off my radar

Regards,
- Tyson

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to