Capture potential problem by error message

This commit is contained in:
Marcus Boerger 2004-04-25 11:25:25 +00:00
parent 286f75c891
commit c5abb9b24c

View File

@ -186,6 +186,13 @@ static int zend_user_it_get_current_key(zend_object_iterator *_iter, char **str_
zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_key, "key", &retval);
if (!retval) {
*str_key = "";
*str_key_len = 0;
*int_key = 0;
zend_error(E_WARNING, "Nothing returned from %s::key()", iter->ce->name);
return HASH_KEY_IS_LONG;
}
switch (retval->type) {
default:
zend_error(E_WARNING, "Illegal type returned from %s::key()", iter->ce->name);