An extension is using zend_call_function to call a userland function.
If the userland function throws an exception, zend_call_function will
still return SUCCESS. Why isn't zend_call_function returning FAILURE
on an exception? Is there a way to check if an exception was thrown
after zend_call_function returns a SUCCESS?
For reference I am looking in Zend/zend_execute_API.c:
if (EG(exception)) {
zend_throw_exception_internal(NULL TSRMLS_CC);
}
return SUCCESS;
--
Herman Radtke
hermanradtke@gmail.com | http://hermanradtke.com
On Sat, 09 Apr 2011 17:03:16 +0100, Herman Radtke hermanradtke@gmail.com
wrote:
An extension is using zend_call_function to call a userland function.
If the userland function throws an exception, zend_call_function will
still return SUCCESS. Why isn't zend_call_function returning FAILURE
on an exception? Is there a way to check if an exception was thrown
after zend_call_function returns a SUCCESS?
Because what "success" means in this context is that the function could be
executed. If you see the implementation of zend_call_function, you'll
notice the conditions that return FAILURE are those where the execution of
the target function doesn't even begin.
You can check for exceptions via EG(exception).
--
Gustavo Lopes
Because what "success" means in this context is that the function could be
executed. If you see the implementation of zend_call_function, you'll notice
the conditions that return FAILURE are those where the execution of the
target function doesn't even begin.You can check for exceptions via EG(exception).
Perfect, thank you.
--
Herman Radtke
hermanradtke@gmail.com | http://hermanradtke.com