Re: Missing __toString() part

From: Date: Sun, 04 Jun 2006 15:42:10 +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 19  Groups: php.internals 
Request: Send a blank email to internals+get-23934@lists.php.net to get a copy of this message
Hello Andi, you don't read my proposals, do you? If you read them you will find that i actually proposed to add a function that uses exactly what you just wrote here. best regards marcus Sunday, June 4, 2006, 5:35:25 PM, you wrote: > 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: >> >>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. >> >> > 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. >> >> >>By 'it hash' nothing to do with hash' i mean that the classname does >> >>not belong into a hash. >> >> > 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, >> Marcus Best regards, Marcus

« previous php.internals (#23934) next »