Skip to content

Add a notice to spl_object_hash() return values comparison #2607

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions reference/spl/functions/spl-object-hash.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ $storage[$id] = $object;
When an object is destroyed, its hash may be reused for other objects.
</para>
</note>
<note>
<para>
Object hashes should be compared for identity with <code>===</code> and
<code>!==</code>, because the returned hash could be a
<link linkend="language.types.numeric-strings">numeric string</link>.
For example: <literal>0000000000000e600000000000000000</literal>.
</para>
</note>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
Expand Down