diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-09-14 12:15:24 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-09-14 12:15:24 +0200 |
commit | 950ea89fb0dbf8d80d9392bd74d8e95d25b85de1 (patch) | |
tree | fd271a2265af1622aa11b882bfa0979f9511a6be | |
parent | 9d3c6665ab0e0b3da92b036e30531d153200e17b (diff) | |
download | php-git-950ea89fb0dbf8d80d9392bd74d8e95d25b85de1.tar.gz |
Convert E_ERROR to Error exception in mysqli_result iterator
The same condition uses Error exceptions in lots of other classes.
-rw-r--r-- | ext/mysqli/mysqli_result_iterator.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/mysqli/mysqli_result_iterator.c b/ext/mysqli/mysqli_result_iterator.c index 1388937816..7aec918bbd 100644 --- a/ext/mysqli/mysqli_result_iterator.c +++ b/ext/mysqli/mysqli_result_iterator.c @@ -45,8 +45,10 @@ zend_object_iterator *php_mysqli_result_get_iterator(zend_class_entry *ce, zval php_mysqli_result_iterator *iterator; if (by_ref) { - zend_error(E_ERROR, "An iterator cannot be used with foreach by reference"); + zend_throw_error(NULL, "An iterator cannot be used with foreach by reference"); + return NULL; } + iterator = ecalloc(1, sizeof(php_mysqli_result_iterator)); zend_iterator_init(&iterator->intern); |