Re: crashing due to get_properties handler
| From: | Rob Richards | Date: | Tue, 31 Jan 2006 11:35:31 +0000 |
| Subject: | Re: crashing due to get_properties handler | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-21743@lists.php.net to get a copy of this message | ||
Here's a patch against HEAD for get_object_vars in
zend_builtin_functions.c that checks for the return value of the
handler. With this change it should at least now be safe to implement
the handler and return NULL, as this was the only spot I found in the
engine that checked only for the existence of the handler and not the
return value.
One question I have about this function is why RETURN_FALSE is used when
the handler is not implemented or NULL is returned (with patch). I can
understand it being returned when used on a non-object, but the function
is supposed to return an array, so I would think and empty array should
be returned instead.
Rob
Andrei Zmievski wrote:
> I've run into the same thing with PHP-GTK. While Zend engine itself
> may check for existence of handler, PHP code does not.
>
> -Andrei