Re: cvs: php-src /ext/spl spl_observer.c /ext/spl/internal splobjectstorage.inc /ext/spl/tests observer_002.phpt
| From: | Marcus Boerger | Date: | Wed, 10 Aug 2005 22:39:03 +0000 |
| Subject: | Re: cvs: php-src /ext/spl spl_observer.c /ext/spl/internal splobjectstorage.inc /ext/spl/tests observer_002.phpt | ||
| References: | 1 2 3 4 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-33283@lists.php.net to get a copy of this message | ||
Hello Andrey,
wrong assumption. That is only the handle but only the handle+handler
combination is unique.
marcus
Thursday, August 11, 2005, 12:32:07 AM, you wrote:
> Marcus Boerger wrote:
>> Hello Andrey,
>>
>> thanks! I wanted to do it earlier but had no idea how to sole the problem.
>> I actually right from the beginning wanted to do all three in there. Anyway
>> you might also want to see t he last slides of my last presentation (the one
>> from OSCON) which you can find here:
>> http://talks.somabo.de/
>>
>> best regards
>> marcus
>>
>> Thursday, August 11, 2005, 12:04:37 AM, you wrote:
>>
>>
>>> Wonderful idea Helly!
>>
>>
>>>Andrey
>>
>>
> However, I think you are wrong that it cannot be implemented in user land with O(1)
> complexity. The following one-liner should give you a hint why I think it is possible.
> andrey@lmy004:~/test> php -r 'class a{} function get_hash_key($obj){ ob_start();
> var_dump($obj); $v=ob_get_contents();
> ob_end_clean();var_dump(substr($v, 7, strpos($v, "
> ", 11) - 7));} get_hash_key(new a);'
> string(4) "a)#1"
> The string is unique per object. ) and # are noise but they are not a problem.
> Best wishes,
> Andrey
Best regards,
Marcus