Skip to content

Commit 950ea89

Browse files
committed
Convert E_ERROR to Error exception in mysqli_result iterator
The same condition uses Error exceptions in lots of other classes.
1 parent 9d3c666 commit 950ea89

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ext/mysqli/mysqli_result_iterator.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ zend_object_iterator *php_mysqli_result_get_iterator(zend_class_entry *ce, zval
4545
php_mysqli_result_iterator *iterator;
4646

4747
if (by_ref) {
48-
zend_error(E_ERROR, "An iterator cannot be used with foreach by reference");
48+
zend_throw_error(NULL, "An iterator cannot be used with foreach by reference");
49+
return NULL;
4950
}
51+
5052
iterator = ecalloc(1, sizeof(php_mysqli_result_iterator));
5153
zend_iterator_init(&iterator->intern);
5254

0 commit comments

Comments
 (0)