Req #55564 [Com]: Make spl_object_hash accept scalars and arrays
| From: | nicolasgrekas@php.net | Date: | Wed, 11 Nov 2020 13:45:08 +0000 |
| Subject: | Req #55564 [Com]: Make spl_object_hash accept scalars and arrays | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-230267@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=55564&edit=1
ID: 55564
Comment by: nicolasgrekas@php.net
Reported by: nicolas dot grekas+php at gmail dot com
Summary: Make spl_object_hash accept scalars and arrays
Status: Feedback
Type: Feature/Change Request
Package: SPL related
PHP Version: 5.3.8
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Thanks for the ping cmb, let's close!
Previous Comments:
------------------------------------------------------------------------
[2020-11-11 13:34:48] cmb@php.net
Is this still relevant, Nicolas?
------------------------------------------------------------------------
[2011-09-01 14:05:26] 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?
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=55564&edit=1