@@ -481,7 +481,9 @@ static void spl_recursive_it_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_cla
481
481
if (zend_parse_parameters_ex (ZEND_PARSE_PARAMS_QUIET , ZEND_NUM_ARGS () TSRMLS_CC , "o|lzl" , & iterator , & flags , & user_caching_it_flags , & mode ) == SUCCESS ) {
482
482
if (instanceof_function (Z_OBJCE_P (iterator ), zend_ce_aggregate TSRMLS_CC )) {
483
483
zval * aggregate = iterator ;
484
+ zend_restore_error_handling (& error_handling TSRMLS_CC );
484
485
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 );
485
487
inc_refcount = 0 ;
486
488
}
487
489
@@ -511,7 +513,9 @@ static void spl_recursive_it_it_construct(INTERNAL_FUNCTION_PARAMETERS, zend_cla
511
513
if (zend_parse_parameters_ex (ZEND_PARSE_PARAMS_QUIET , ZEND_NUM_ARGS () TSRMLS_CC , "o|ll" , & iterator , & mode , & flags ) == SUCCESS ) {
512
514
if (instanceof_function (Z_OBJCE_P (iterator ), zend_ce_aggregate TSRMLS_CC )) {
513
515
zval * aggregate = iterator ;
516
+ zend_restore_error_handling (& error_handling TSRMLS_CC );
514
517
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 );
515
519
inc_refcount = 0 ;
516
520
}
517
521
} else {
@@ -1514,7 +1518,9 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z
1514
1518
ce = * pce_cast ;
1515
1519
}
1516
1520
if (instanceof_function (ce , zend_ce_aggregate TSRMLS_CC )) {
1521
+ zend_restore_error_handling (& error_handling TSRMLS_CC );
1517
1522
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 );
1518
1524
if (EG (exception )) {
1519
1525
if (retval ) {
1520
1526
zval_ptr_dtor (& retval );
0 commit comments