3 ms·
why does php garbage collect anything when there is a reference ? (weakmaps)
by abbiya 7y ago
why does php garbage collect anything when there is a reference ? (weakmaps)
- detaro 7y agoIt doesn't, unless you specifically tell it that it should ignore a reference by using a weakref or weakmap.
- function_seven 7y agoRight now, it doesn't. If there's a reference, then the item is not garbage collected. The WeakMaps change will allow a developer to take a reference to something but say, "Hey, I'm caching this for now, but if you need the space, I'm not married to it."