mirror of
https://github.com/php/php-src.git
synced 2024-11-24 18:34:21 +08:00
Capture potential problem by error message
This commit is contained in:
parent
286f75c891
commit
c5abb9b24c
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user