Re: Missing __toString() part
| From: | Andi Gutmans | Date: | Sun, 04 Jun 2006 15:35:25 +0000 |
| Subject: | Re: Missing __toString() part | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-23932@lists.php.net to get a copy of this message | ||
Yes, I realize that but it doesn't happen today and I don't think we couldn't make this a rule (requiring extensions to have unique id's per classes). In any case, we can always make it the following string:
"id=<ht table address in hex>#unique id"
Andi
At 08:18 AM 6/4/2006, Marcus Boerger wrote:
Hello Andi, the classname doesn't help, it is the handler that you need. In theory you can have two objects with the same id and classname but not with the same id and handler table. best regards marcus Sunday, June 4, 2006, 5:14:46 PM, you wrote: At 08:08 AM 6/4/2006, Marcus Boerger wrote:The object id itself is not unique, but coupled with the class name it is. All this means is that the unique id has to be a string and not a number. I mentioned in the past that it'd be a problem to have a number as the unique id.Hello Andi, it was your own argument that the id itself is not unique when some time ago somebody wanted to have access to that id from userland. And it is also the reason for SplObjectStorage the way it is today.My point is that the string "ClassName#id" is what would be the unique identifier. e.g. that's what toKey() would return (assuming we'd want such a method). Andi Best regards, MarcusBy 'it hash' nothing to do with hash' i mean that the classname does not belong into a hash.