Re: Exposing object handles to userland

From: Date: Tue, 11 Jul 2017 20:56:36 +0000
Subject: Re: Exposing object handles to userland
References: 1 2 3 4 5 6 7 8 9  Groups: php.internals 
Request: Send a blank email to internals+get-99845@lists.php.net to get a copy of this message
> Just to clarify, that means object ids are still re-used between > objects if one gets destroyed? > The initial bug report was about creating a second function that solves this problem.  Correct. This is intended to return the object handles. The most recent discussion from 2015 was only about object handles. An intended side effect is that object ids are re-used, the same way spl_object_hash is reused. - i.e. this is not intended to solve https://bugs.php.net/bug.php?id=52657 , and NEWS should not link to that bug id. Having unique integers wouldn't work as an integer in long runs of processes 32-bit builds - After ~4 billion objects were constructed, the 32-bit integer would be reused. As for a globally unique object id (let's call that spl_object_uuid), I don't think it'll ever get included. I also don't have any need for it. - It would require adding an additional field to zend_object, which would hurt performance and increase overall memory usage (e.g. increasing 64-bit integer) - No other programming languages I'm aware of have that (globally unique object id, even after object is garbage collected) as a native feature.

« previous php.internals (#99845) next »