diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2018-02-19 21:57:07 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2018-02-19 21:58:56 +0100 |
commit | ede663f38145e910703f47aa9c51f7947cc10540 (patch) | |
tree | 603403b7de25fab619c25ba63f8e5240608ec2c4 /ext/pdo | |
parent | bcc7d46aa463e86467e3030d66f2e0611b834c62 (diff) | |
download | php-git-ede663f38145e910703f47aa9c51f7947cc10540.tar.gz |
Convert iterator by reference errors to exceptions
I'm using RuntimeException in SPL, because other SPL classes that
throw this error used it. Error is used for everything else, because
that's what core does.
Diffstat (limited to 'ext/pdo')
-rw-r--r-- | ext/pdo/pdo_stmt.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 31987ff2e5..423f0e6260 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -2469,7 +2469,8 @@ zend_object_iterator *pdo_stmt_iter_get(zend_class_entry *ce, zval *object, int struct php_pdo_iterator *I; 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; } I = ecalloc(1, sizeof(struct php_pdo_iterator)); |