I was precisely hoping there was a WeakRef implementation the other day.
This would be very useful for a simple data mapper, where you could keep
references to loaded objects and a cache of their original properties, to
compute the changeset to sync to the DB when save()ing them.
WeakRefs would allow to automatically clean up the cache of loaded
properties when the object goes out of scope and is reclaimed by the GC.

So, FWIW, big +1 from me, and thank you for the RFC and the PR! 👍

Ben

On Sat, 2 Feb 2019 at 09:35, Joe Watkins <krak...@php.net> wrote:

> Morning internals,
>
> Some time ago I brought this up for discussion, and last night was reminded
> of it's existence, and so this morning rebased and reworked the patch a
> little based on the feedback I got back then.
>
> Since it was long ago, and there's no particular rush, I don't intend to
> open voting until the current policy adjustment RFC's are resolved, but
> wanted to give everyone a heads up and ask for any feedback you may have at
> this time.
>
> https://wiki.php.net/rfc/weakrefs
>
> Cheers
> Joe
>

Reply via email to