Re: [RFC] Lazy Objects
| From: | Marco Pivetta | Date: | Tue, 06 Aug 2024 09:15:49 +0000 |
| Subject: | Re: [RFC] Lazy Objects | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-124799@lists.php.net to get a copy of this message | ||
Hey Côme,
On Tue, 6 Aug 2024 at 11:05, Côme Chilliet <come@chilliet.eu> wrote:
>
> What does Proxy allows that Ghost do not?
>
Ghosts work well when you need to use the object identity, such as:
*
$a === $b checks
* spl_object_id(...)
* SplObjectStorage
Ghost objects operate at property level, and can only ever work with
concrete classes.
IMO, proxies can operate also at interface level (probably future scope),
and could be expanded to not need a concrete implementation until the
initialization callback is reached.
Marco Pivetta
https://mastodon.social/@ocramius
https://ocramius.github.io/