note 94647 deleted from function.spl-object-hash by googleguy
| From: | googleguy@php.net | Date: | Mon, 08 Oct 2012 04:12:03 +0000 |
| Subject: | note 94647 deleted from function.spl-object-hash by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-191178@lists.php.net to get a copy of this message | ||
Note Submitter: markus dot albe at mailinator dot com
----
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"
*/
?>