php.net |  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
Votes:6
Avg. Score:4.8 ± 0.4
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
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
Description:
------------
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?


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-02-28 20:01 UTC] cmb@php.net
-Package: Unknown/Other Function +Package: SPL related
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Nov 14 16:01:42 2019 UTC