|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #55564 Make spl_object_hash accept scalars and arrays
Submitted: 2011-09-01 14:05 UTC Modified: 2020-11-11 14:47 UTC
Avg. Score:4.6 ± 0.7
Reproduced:5 of 5 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: nicolas dot grekas+php at gmail dot com Assigned: cmb (profile)
Status: Closed Package: SPL related
PHP Version: 5.3.8 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: nicolas dot grekas+php at gmail dot com
New email:
PHP Version: OS:


 [2011-09-01 14:05 UTC] nicolas dot grekas+php at gmail dot com
Currently, spl_object_hash() only works on objects. But for scalars and even more arrays, PHP lacks a way to check for circular references.

As serialize() is able to dump circular data structures, its seams PHP internally has all what's needed.

If spl_object_hash() could work on any variable type, it would be fantastic!

If that can't be done because of call by value, maybe a new
spl_ref_hash(&$var) working like spl_object_hash but taking its argument by reference could work?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-02-28 20:01 UTC]
-Package: Unknown/Other Function +Package: SPL related
 [2020-11-11 13:34 UTC]
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2020-11-11 13:34 UTC]
Is this still relevant, Nicolas?
 [2020-11-11 13:45 UTC]
Thanks for the ping cmb, let's close!
 [2020-11-11 14:47 UTC]
-Status: Feedback +Status: Closed
 [2020-11-11 14:47 UTC]
Thanks for the swift reply!
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Dec 01 07:03:34 2021 UTC