#50817 [Opn->Csd]: Dangerously vague documentation for spl_object_hash()
| From: | degeberg@php.net | Date: | Thu, 21 Jan 2010 22:58:32 +0000 |
| Subject: | #50817 [Opn->Csd]: Dangerously vague documentation for spl_object_hash() | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-3768@lists.php.net to get a copy of this message | ||
ID: 50817
Updated by: degeberg@php.net
Reported By: michaelzajonz at web dot de
-Status: Open
+Status: Closed
Bug Type: Documentation problem
Operating System: --
PHP Version: Irrelevant
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation
better.
Previous Comments:
------------------------------------------------------------------------
[2010-01-21 22:58:09] svn@php.net
Automatic comment from SVN on behalf of degeberg
Revision: http://svn.php.net/viewvc/?view=revision&revision=293824
Log: Fixed bug #50817 (Dangerously vague documentation for
spl_object_hash())
------------------------------------------------------------------------
[2010-01-21 22:56:34] michaelzajonz at web dot de
(Of course the reproduce code results in different output.
Excpected/actual result apply to the documentation problem)
------------------------------------------------------------------------
[2010-01-21 22:51:54] michaelzajonz at web dot de
Description:
------------
This is NOT a bug report regarding the implementation of
spl_object_hash() but rather its documentation!
It says there
(http://de.php.net/manual/en/function.spl-object-hash.php) for the
return value of function spl_object_hash():
"A string that is unique for each object and is always the same for the
same object."
I used this function for a while now, also in production environment.
Recently I coincidentally discovered a user-contributed comment saying
that the IDs of destroyed objects will be reused.
The Documentation itself should say so, I think.
While debugging some other issue in my code I actually observed a case
where this would have led to a serious problem (for now, I just appended
the current microtime, since the class I'm dealing with is kinda huge
and takes a while to instantiate. Still sucks of course.).
Reproduce code:
---------------
var_dump(spl_object_hash(new stdClass()), spl_object_hash(new
stdClass()));
Expected result:
----------------
"A string that is unique for each object and is always the same for the
same object."
Actual result:
--------------
"A string that is unique for each currently existing object and is
always the same for the same object."
or something like that
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50817&edit=1