Req #55564 [Opn->Fbk]: Make spl_object_hash accept scalars and arrays

From: Date: Wed, 11 Nov 2020 13:34:48 +0000
Subject: Req #55564 [Opn->Fbk]: Make spl_object_hash accept scalars and arrays
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-230266@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 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: Open +Status: Feedback Type: Feature/Change Request Package: SPL related PHP Version: 5.3.8 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: Is this still relevant, Nicolas? Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#230266) next »