Hi
Am 2025-06-05 08:04, schrieb Nick:
Semantically once you involved inheritance it isn't that easy. It is
allowed to override an “unhooked” property with a hooked property and
in the “Readonly Amendments” RFC we already decided that inheriting
from a `readonly` class by a non-`readonly` class
Hi
Am 2025-06-04 15:39, schrieb Nick:
Your test cases really only scratch the surface of what should be
tested. You are basically just verifying that it compiles. In fact you
are not even testing that reassigning the property is disallowed,
because the test fails due to a visibility error. In
Hey Larry,
> On 6. Jun 2025, at 01:06, Larry Garfield wrote:
>> Would this be expected to work? Can interface properties be declared
>> `readonly`?
>> interface Cleaned
>> {
>>public readonly string $clean { get; } // has readonly
>> }
>
> Interface properties cannot be declared readonly to
On Thu, Jun 5, 2025, at 1:12 AM, Nick wrote:
> Hey internals,
>
>> On 4. Jun 2025, at 20:19, Nick wrote:
>>> I believe at the moment that RFC text is all there is. :-) I don't know
>>> that it's worth opening a discussion without at least a mostly-done
>>> implementation. Also, Ilija is rather
Hey internals,
> On 4. Jun 2025, at 20:19, Nick wrote:
>> I believe at the moment that RFC text is all there is. :-) I don't know
>> that it's worth opening a discussion without at least a mostly-done
>> implementation. Also, Ilija is rather busy on other tasks at the moment, as
>> am I. (U
Hey Tim,
> On 4. Jun 2025, at 21:09, Tim Düsterhus wrote:
>
> Semantically once you involved inheritance it isn't that easy. It is allowed
> to override an “unhooked” property with a hooked property and in the
> “Readonly Amendments” RFC we already decided that inheriting from a
> `readonly`
Hey Tim,
> On 4. Jun 2025, at 21:09, Tim Düsterhus wrote:
>
> Hi
>
> Am 2025-06-04 14:19, schrieb Nick:
>> Fair. If someone really wants to add random_int(): "well, that assumption
>> doesn't hold anymore, deal” from my side.
>
> Semantically once you involved inheritance it isn't that easy.
Hi
Am 2025-06-04 14:19, schrieb Nick:
Fair. If someone really wants to add random_int(): "well, that
assumption doesn't hold anymore, deal” from my side.
Semantically once you involved inheritance it isn't that easy. It is
allowed to override an “unhooked” property with a hooked property and
Hi Larry,
On 03.06.25 19:03, Larry Garfield wrote:
On Mon, Jun 2, 2025, at 11:34 PM, Nick wrote:
I would like to add, personally, I don’t believe the above is dumb:
```php
class Dumb {
public readonly int $value { get => $this->value * random_int(1, 100); }
}
```
I think it is a legitimate u
Hey all,
> On 4. Jun 2025, at 01:03, Larry Garfield wrote:
>
> It's about expectation setting. If you see a property marked `readonly`,
> it's reasonable to expect this to be true:
>
> $foo->bar == $foo->bar;
>
> For a traditional field (pre-hooks), this would be trivially true. With
> hoo
On Mon, Jun 2, 2025, at 11:34 PM, Nick wrote:
> I would like to add, personally, I don’t believe the above is dumb:
>
> ```php
> class Dumb {
> public readonly int $value { get => $this->value * random_int(1, 100); }
> }
> ```
>
> I think it is a legitimate use-case.
> Why wouldn’t a `readonly` pr
Hey Larry,
Thanks for your answer.
> On 2. Jun 2025, at 21:39, Larry Garfield wrote:
> This was discussed heavily in the design and discussion phase for hooks. The
> main problem is that the expectations for readonly and the expectations for
> hooks don't always align. For example, if a virt
On Mon, Jun 2, 2025, at 7:49 AM, Nick wrote:
> Dear Internals,
>
> I am sending my first message here. Thank you all for your hard work!
Greetings.
> I believe promoted properties should allowed for `readonly` properties
> and in `readonly` classes. This would help us to avoid the unnecessary
>
13 matches
Mail list logo