Re: [RFC] Lazy Objects
| From: | Larry Garfield | Date: | Wed, 17 Jul 2024 22:08:14 +0000 |
| Subject: | Re: [RFC] Lazy Objects | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-124461@lists.php.net to get a copy of this message | ||
On Wed, Jul 17, 2024, at 6:31 PM, Nicolas Grekas wrote:
> A bit unrelated to the above topic: we've further clarified the RFC by
> addition restrictions to what can be done with lazy proxies. Namely,
> when the factory returns an object from a parent class, we describe
> that adding more on the proxy class would throw, and we also explain
> why. We also added a restriction to prevent a proxy from having an
> overridden __clone or __destruct when the factory returns a parent, and
> explained why again.
>
> This should simplify the overall behavior by preventing edge case that
> wouldn't have easy answers. If those limitations prove too restrictive
> in practice (my experience tells me they should be fine), they could be
> leveraged in the future.
>
> On our side, this should close the last topics we wanted to address
> before opening the vote.
>
> Please let us know if anyone has other concerns.
>
> Cheers,
> Nicolas
Minor point: Why is the $initializer return type null, instead of void? I don't see a purpose
to allowing an explicit null return and nothing else.
Otherwise, I'm quite looking forward to this.
--Larry Garfield