Req #55564 [Fbk->Csd]: Make spl_object_hash accept scalars and arrays
Edit report at https://bugs.php.net/bug.php?id=55564&edit=1
ID: 55564
Updated by: cmb@php.net
Reported by: nicolas dot grekas+php at gmail dot com
Summary: Make spl_object_hash accept scalars and arrays
-Status: Feedback
+Status: Closed
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 swift reply!
Previous Comments:
------------------------------------------------------------------------
[2020-11-11 13:45:08] nicolasgrekas@php.net
Thanks for the ping cmb, let's close!
------------------------------------------------------------------------
[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
Thread (4 messages)