reference/spl/functions/spl-object-hash.xml
f7e42edba898d3a07f5213360e9464fbf526b20e
...
...
@@ -11,11 +11,14 @@
11
11
&reftitle.description;
12
12
<methodsynopsis>
13
13
<type>string</type><methodname>spl_object_hash</methodname>
14
-
<methodparam><type>object</type><parameter>obj</parameter></methodparam>
14
+
<methodparam><type>object</type><parameter>object</parameter></methodparam>
15
15
</methodsynopsis>
16
16
<para>
17
17
This function returns a unique identifier for the object. This id can be
18
-
used as a hash key for storing objects or for identifying an object.
18
+
used as a hash key for storing objects, or for identifying an object, as long
19
+
as the object is not destroyed. Once the object is destroyed, its hash may
20
+
be reused for other objects. This behavior is similar to
21
+
<function>spl_object_id</function>.
19
22
</para>
20
23
</refsect1>
21
24

...
...
@@ -67,9 +70,24 @@ $storage[$id] = $object;
67
70
When an object is destroyed, its hash may be reused for other objects.
68
71
</para>
69
72
</note>
73
+
<note>
74
+
<para>
75
+
Object hashes should be compared for identity with <code>===</code> and
76
+
<code>!==</code>, because the returned hash could be a
77
+
<link linkend="language.types.numeric-strings">numeric string</link>.
78
+
For example: <literal>0000000000000e600000000000000000</literal>.
79
+
</para>
80
+
</note>
81
+
</refsect1>
82
+
<refsect1 role="seealso">
83
+
&reftitle.seealso;
84
+
<para>
85
+
<simplelist>
86
+
<member><function>spl_object_id</function></member>
87
+
</simplelist>
88
+
</para>
70
89
</refsect1>
71
90
</refentry>
72
-

73
91
<!-- Keep this comment at the end of the file
74
92
Local variables:
75
93
mode: sgml
76
94