note 94647 added to function.spl-object-hash

From: Date: Mon, 16 Nov 2009 19:53:51 +0000
Subject: note 94647 added to function.spl-object-hash
Groups: php.notes 
Request: Send a blank email to php-notes+get-162960@lists.php.net to get a copy of this message
It seems that when switching scopes, the last one is repeated... Not necessarily a bug, but could create some problems/unexpected behavior <?php $var = new stdClass(); var_dump(spl_object_hash($var), spl_object_hash(new stdClass())); hola(); function hola() { $var = new stdClass(); var_dump(spl_object_hash($var), spl_object_hash(new stdClass())); } /* will output something like string(32) "f4c9a9e4c63bb94a344b09fa90b57d5c" string(32) "7b6e43337944619e217ded14a7a78d35" string(32) "7b6e43337944619e217ded14a7a78d35" string(32) "ebd1bf725146297194bb011ef5e9c4d5" */ ?> ---- Server IP: 69.147.83.197 Probable Submitter: 190.108.30.12 ---- Manual Page -- http://www.php.net/manual/en/function.spl-object-hash.php Edit -- https://master.php.net/note/edit/94647 Del: integrated -- https://master.php.net/note/delete/94647/integrated Del: useless -- https://master.php.net/note/delete/94647/useless Del: bad code -- https://master.php.net/note/delete/94647/bad+code Del: spam -- https://master.php.net/note/delete/94647/spam Del: non-english -- https://master.php.net/note/delete/94647/non-english Del: in docs -- https://master.php.net/note/delete/94647/in+docs Del: other reasons-- https://master.php.net/note/delete/94647 Reject -- https://master.php.net/note/reject/94647 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#162960) next »