Re: toString() and Object #ID

From: Date: Wed, 04 Jul 2007 12:16:17 +0000
Subject: Re: toString() and Object #ID
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to internals+get-30436@lists.php.net to get a copy of this message
Not quite. It creates a hash of an object, so two objects with the same data yield the same hashes: var_dump(spl_object_hash(new stdClass()), spl_object_hash(new stdClass())); I don't believe that it's data dependent. Rather in your example the same memory-space is used for those two objects because they don't exist in parallel. The first is cleared before the second is instantiated.
<? $x = new stdClass(); $y = new stdClass(); var_dump(spl_object_hash($x), spl_object_hash($y)); ?> This yields a difference.

« previous php.internals (#30436) next »