Hi people. I've been pinged many times to add a new spl_object_id() function to PHP, that would return the internal object handle of an object.
Today, spl_object_hash() partially allows that, but adds many randomness to the result, which is not very cool to use later (why does it even add randomness ?). There has been topics about this subject. For example, at http://marc.info/?l=php-internals&m=141814350920452&w=2 Beeing able to get the object handle back in PHP userland would ease many tools, mainly debug-oriented tools. I know PHPUnit, Symfony and many big projects today make use of spl_object_hash() to identify objects. I also know people that print_r($an_object) and parse the output just to extract the object handle from there... Crazy isn't it ? Why couldn't we help those people by simply adding a new function that does the job ? Thoughts ? Julien.Pauli