Re: toString() and Object #ID

From: Date: Mon, 02 Jul 2007 17:52:03 +0000
Subject: Re: toString() and Object #ID
References: 1 2 3 4 5 6 7 8 9 10 11 12 13  Groups: php.internals 
Request: Send a blank email to internals+get-30409@lists.php.net to get a copy of this message
We could add a counter that gets incremented for each object that is created and associate that number with the object. Wouldn't that solve the problem (if there is one)?
It would solve it, but it would require modifying each extension dealing with objects in order to register all objects in this global registry and of course it would require adding another value into object structure. I'm not sure having running numeric ID is that important. If you just need to know if two variables are the same object, you have ===. If you need to index by it, you have the hash. -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com

« previous php.internals (#30409) next »