Re: toString() and Object #ID

From: Date: Mon, 02 Jul 2007 18:37:59 +0000
Subject: Re: toString() and Object #ID
References: 1 2 3 4 5 6 7 8 9 10 11 12 13  Groups: php.internals 
Request: Send a blank email to internals+get-30412@lists.php.net to get a copy of this message
On 02.07.2007 22:16, David wrote:
(Many apologies for the double e-mail. Ugh, I'm not used to hitting Reply To All yet) I really don't want to be annoying but from the end user's POV spl_object_hash sounds like a function which returns a hash but not
an
identity. Any tiny chance it will be available as object_get_id in PHP6? ;)
It does give the hash, which is unique for each object. In which form would you expect object_get_id to return object's identity? PHP doesn't have a type of "tuple of C pointer and long integer" ;)
Hmm. I think what Pavel is asking is just to make it clearer in the documentation what spl_object_hash's purpose and workings are
That's fine, the docu team would gladly accept any help and patches.
and perhaps make an alias to it named object_get_id so other people don't run into this confusion in the future.
I'd like to avoid creating misleading aliases, which would not be usable on a shared hosting in the next 10 years anyway.
The name of spl_object_hash and the fact it is in the SPL and not in the engine does lead one to believe that it might do more than simply hashing the handler table and handle tuple. People might think it hashes the properties as well.
People won't think anything like that if we fix the documentation, so let's do it. -- Wbr, Antony Dovgal

« previous php.internals (#30412) next »