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