crashing due to get_properties handler
| From: | Rob Richards | Date: | Fri, 27 Jan 2006 16:47:27 +0000 |
| Subject: | crashing due to get_properties handler | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-21706@lists.php.net to get a copy of this message | ||
Is it required that the get_properties handler be implemented for an object?
In the source there are places that it tests if it is implemented and then tests the returned value in the event it is NULL.
The problem is that this is not consistent throughout the zend and php source and I'm getting crashes on certain calls.
For example:
calling var_dump in var.c: Z_OBJPROP_PP is used without testing if implemented so the handler is required otherwise crash.
get_object_vars in zend_builtin_functions.c: checks to see if it is implemented, but doesn't test the return value in the case of NULL.
I assume checks for both the handler existing and the return value possibly being NULL are what should be used throughout the code, but wanted to check on that first.
Rob