|  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: 2018-02-28 20:01 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:
Status: Open 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
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Oct 27 01:01:23 2020 UTC