On Sun, Oct 7, 2012 at 7:07 PM, Rasmus Schultz <ras...@mindplay.dk> wrote: > Yeah, on that note - I've never understood what use this function is, > as it reuses object IDs... it will return the same hash for two > different objects during the same script execution - so it's unusable > as far as getting unique keys for objects... and I don't know what > else you could really use it for? >
Sorry, forgot to reply to all here... No it's not. "Reuses object IDs" here just means when an object is destroyed it no longer exists in memory and thus its hash becomes reusable, which makes absolutely perfect sense to me. This does not make it "unusable as far as getting unique keys for objects". The keys are unique for all the objects that exist in memory at that time. If an object is destroyed (it no longer exists in memory), why would you still need to retain a unique key for it? Do you keep keys for nonexistent doors as well? > On Sun, Oct 7, 2012 at 5:01 AM, Pierre Joye <pierre....@gmail.com> wrote: >> >> Object hash may be what you are looking for. >> >> http://php.net/manual/en/function.spl-object-hash.php > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php