Convert E_ERROR to Error exception in mysqli_result iterator

The same condition uses Error exceptions in lots of other classes.
This commit is contained in:
Nikita Popov 2020-09-14 12:15:24 +02:00
parent 9d3c6665ab
commit 950ea89fb0

View file

@ -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);