Re: [RFC] Lazy Objects

From: 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 [email protected] to get a copy of this message
Hey Côme,

On Tue, 6 Aug 2024 at 11:05, Côme Chilliet <[email protected]> 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/


Thread (95 messages)

« previous php.internals (#124799) next »