return;
}
+ ZEND_ASSERT(instanceof_function(add_previous->ce, zend_ce_throwable)
+ && "Previous execption must implement Throwable");
+
ZVAL_OBJ(&pv, add_previous);
- if (!instanceof_function(Z_OBJCE(pv), zend_ce_throwable)) {
- zend_error_noreturn(E_CORE_ERROR, "Previous exception must implement Throwable");
- return;
- }
ZVAL_OBJ(&zv, exception);
ex = &zv;
do {
{
zval ex, tmp;
- if (exception_ce) {
- if (!instanceof_function(exception_ce, zend_ce_throwable)) {
- zend_error(E_NOTICE, "Exceptions must implement Throwable");
- exception_ce = zend_ce_exception;
- }
- } else {
+ if (!exception_ce) {
exception_ce = zend_ce_exception;
}
- object_init_ex(&ex, exception_ce);
+ ZEND_ASSERT(instanceof_function(exception_ce, zend_ce_throwable)
+ && "Exceptions must implement Throwable");
+
+ object_init_ex(&ex, exception_ce);
if (message) {
ZVAL_STR(&tmp, message);