@@ -481,7 +481,9 @@ static void spl_recursive_it_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_cla
481481 if (zend_parse_parameters_ex (ZEND_PARSE_PARAMS_QUIET , ZEND_NUM_ARGS () TSRMLS_CC , "o|lzl" , & iterator , & flags , & user_caching_it_flags , & mode ) == SUCCESS ) {
482482 if (instanceof_function (Z_OBJCE_P (iterator ), zend_ce_aggregate TSRMLS_CC )) {
483483 zval * aggregate = iterator ;
484+ zend_restore_error_handling (& error_handling TSRMLS_CC );
484485 zend_call_method_with_0_params (& aggregate , Z_OBJCE_P (aggregate ), & Z_OBJCE_P (aggregate )-> iterator_funcs .zf_new_iterator , "getiterator" , & iterator );
486+ zend_replace_error_handling (EH_THROW , spl_ce_InvalidArgumentException , & error_handling TSRMLS_CC );
485487 inc_refcount = 0 ;
486488 }
487489
@@ -511,7 +513,9 @@ static void spl_recursive_it_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_cla
511513 if (zend_parse_parameters_ex (ZEND_PARSE_PARAMS_QUIET , ZEND_NUM_ARGS () TSRMLS_CC , "o|ll" , & iterator , & mode , & flags ) == SUCCESS ) {
512514 if (instanceof_function (Z_OBJCE_P (iterator ), zend_ce_aggregate TSRMLS_CC )) {
513515 zval * aggregate = iterator ;
516+ zend_restore_error_handling (& error_handling TSRMLS_CC );
514517 zend_call_method_with_0_params (& aggregate , Z_OBJCE_P (aggregate ), & Z_OBJCE_P (aggregate )-> iterator_funcs .zf_new_iterator , "getiterator" , & iterator );
518+ zend_replace_error_handling (EH_THROW , spl_ce_InvalidArgumentException , & error_handling TSRMLS_CC );
515519 inc_refcount = 0 ;
516520 }
517521 } else {
@@ -1514,7 +1518,9 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z
15141518 ce = * pce_cast ;
15151519 }
15161520 if (instanceof_function (ce , zend_ce_aggregate TSRMLS_CC )) {
1521+ zend_restore_error_handling (& error_handling TSRMLS_CC );
15171522 zend_call_method_with_0_params (& zobject , ce , & ce -> iterator_funcs .zf_new_iterator , "getiterator" , & retval );
1523+ zend_replace_error_handling (EH_THROW , spl_ce_InvalidArgumentException , & error_handling TSRMLS_CC );
15181524 if (EG (exception )) {
15191525 if (retval ) {
15201526 zval_ptr_dtor (& retval );
0 commit comments