Re: toString() and Object #ID

From: Date: Wed, 04 Jul 2007 12:33:07 +0000
Subject: Re: toString() and Object #ID
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.internals 
Request: Send a blank email to internals+get-30439@lists.php.net to get a copy of this message
Oh, that clears everything, please ignore my previous post. Still, don't you think this is a bit misleading? IMHO, new object should always have the unique id(or hash in terms of spl)... I don't like it either;) But it does exactly what Stanislav Malyshev described: it hashes the "tuple of C pointer". Misleading in this case is that this is only unique as long as the compared objects exist at the same time...then they can't inhabit the same memory-space. But because php clears and reuses memory as soon as no pointers to the object exist (reference counting). In this case php uses the exact same "tuple of C pointer" for the next object as the for the previous one. At least...that's my interpretation of this behaviour;)


« previous php.internals (#30439) next »