Re: [RFC] Lazy Objects

From: Date: Tue, 06 Aug 2024 09:01:54 +0000
Subject: Re: [RFC] Lazy Objects
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-124798@lists.php.net to get a copy of this message
Le mardi 4 juin 2024, 14:28:53 UTC+2 Nicolas Grekas a écrit : > Dear all, > > Arnaud and I are pleased to share with you the RFC we've been shaping for > over a year to add native support for lazy objects to PHP. > > Please find all the details here: > https://wiki.php.net/rfc/lazy-objects > > We look forward to your thoughts and feedback. > > Cheers, > Nicolas and Arnaud > Hello, I’m a bit late to the party, but after reading the RFC I still do not understand the difference between Ghost and Proxy. I do understand the technical internal difference, I think, of 1 vs 2 objects, and the API differences of passing a constructor vs a factory function. But I do not understand the difference from the caller point of view, how would I choose when to use one or the other depending on my usecase? What does Proxy allows that Ghost do not? Or do Proxy only make sense when returning a parent class from the factory method? Côme

« previous php.internals (#124798) next »