[php-src] Issue #7862: `spl_object_id` should never reuse an old value
| From: | cmb69 | Date: | Fri, 31 Dec 2021 17:48:24 +0000 |
| Subject: | [php-src] Issue #7862: `spl_object_id` should never reuse an old value | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-238689@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/7862
Comment Author: cmb69
As is,
spl_object_id() returns the handle of the object, i.e. the numeric offset into
the object store. If we used a unique ID instead, the object store would need to be a hash table
instead of a simple array.
But maybe the more relevant question is, why would you need a unique value, if you can already
accomplish your use case with a WeakMap?