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/com_dotnet/com_saproxy.c | |
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/com_dotnet/com_saproxy.c')
-rw-r--r-- | ext/com_dotnet/com_saproxy.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/com_dotnet/com_saproxy.c b/ext/com_dotnet/com_saproxy.c index 01acd58274..81bbb63ca8 100644 --- a/ext/com_dotnet/com_saproxy.c +++ b/ext/com_dotnet/com_saproxy.c @@ -542,7 +542,8 @@ zend_object_iterator *php_com_saproxy_iter_get(zend_class_entry *ce, zval *objec int 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(*I)); |