Hi Nikita,

Am 04.12.19 um 19:50 schrieb Nikita Popov:
>> This RFC proposes to add a native WeakMap type for PHP 8:
>> https://wiki.php.net/rfc/weak_maps
>
> Any comments on this proposal? Otherwise this could head to voting...

thanks for this proposal, will be really helpful!

The only caveat for me is that WeakMap is not serializable. Wouldn't it
be possible to allow serialization by just serializing it as an array
with all objects that are still valid? This would avoid serialization
errors and make using it with serialization very easy. It would not
unserialize as a WeakMap but that is not that a great problem for me.

Or maybe it could extend SplObjectStorage (or implement the same [new]
interface) and could be serialized as an SplObjectStorage object instead
of an array.

Thanks for your great work, keep it up!

Greets
Dennis

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to