Hello Stanislav,

  do you remember any reason why we have the current layout with the zval
pointing to a handler and that having a function which returns a pointer
to the class_entry as well as a function that returns the name?

struct _zend_object_handlers {
[...]
        zend_object_get_class_entry_t                   get_class_entry;
        zend_object_get_class_name_t                    get_class_name;


typedef struct _zend_object_value {
        zend_object_handle handle;
        zend_object_handlers *handlers;
} zend_object_value;

And wouldn't it be faster to drop both handlers from the table and
instead have zend_object_value have a pointer to zend_class_entry
and that a pounter to the handler table?

best regards
marcus

Sunday, June 4, 2006, 5:42:02 PM, you wrote:

AG>>>We should probably make this a requirement and I don't know of one 
AG>>>today that doesn't have an associated class name. I believe some parts 
AG>>>of PHP might blow up if this isn't supported.

> There are parts that can blow up if get_class_name is NULL or returns NULL 
> (though good practice would be to filter such places out but I'm not sure 
> it was ever accomplished) - however it doesn't have to be NULL to be a 
> problem. Imagine two extensions that bridge external objects - e.g., Java 
> and .Net one - that attempt to return real class of an object, but if it 
> doesn't succeed (e.g., internal reflection doesn't work for some reason) 
> they return "???" instead. It's not that good, but we can't catch it and 
> we can't even put up a requirement out saying "your 'don't know' value 
> should be different from other's" - how's one supposed to know what 
> other's value is? And if you don't do something very unrelated would break 
> in very strange ways - so it's be quite hard even point to what is the 
> cause.
> So in fact classname here would not be a good idea for ID. Handler table, 
> however, combined with object handle seems to be good way to ID an object 
> - it's how the engine identifies them after all...



Best regards,
 Marcus

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to