Re: spl_object_hash documentation
| From: | Hannes Magnusson | Date: | Sat, 07 Jun 2014 17:29:26 +0000 |
| Subject: | Re: spl_object_hash documentation | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969384980@lists.php.net to get a copy of this message | ||
On Sat, Jun 7, 2014 at 9:42 AM, Karoly Negyesi <karoly@negyesi.net> wrote:
> Hi,
>
> I have seen many bogus pieces of code which presume that spl_object_hash is
> usable for anything; that it gives you a hash that represents an object
> uniquely for the life of the script. This is (not) obviously not true: the
> hash gets reused and the hash does not depend on the properties and the
> values of the properties.
>
> I tried to ask for a review on IRC but the result was the sort of
> otherworldly discussion I am used to on PHP Internals only, not here.
>
> Anyways, I put the suggested changes on
> http://privatepaste.com/95c871de6c .
> Suggestions welcome. Suggesting I am in idiot is not.
"Using this
+ function for anything but the previous example will very likely lead to
+ hard to debug problems and even data corruption."
This is obviously not gonna be in the docs.
-Hannes