@@ -3573,11 +3573,7 @@ PHP_FUNCTION(iterator_to_array)
3573
3573
}
3574
3574
3575
3575
array_init (return_value );
3576
-
3577
- if (spl_iterator_apply (obj , use_keys ? spl_iterator_to_array_apply : spl_iterator_to_values_apply , (void * )return_value ) != SUCCESS ) {
3578
- zval_ptr_dtor (return_value );
3579
- RETURN_NULL ();
3580
- }
3576
+ spl_iterator_apply (obj , use_keys ? spl_iterator_to_array_apply : spl_iterator_to_values_apply , (void * )return_value );
3581
3577
} /* }}} */
3582
3578
3583
3579
static int spl_iterator_count_apply (zend_object_iterator * iter , void * puser ) /* {{{ */
@@ -3598,9 +3594,11 @@ PHP_FUNCTION(iterator_count)
3598
3594
RETURN_FALSE ;
3599
3595
}
3600
3596
3601
- if (spl_iterator_apply (obj , spl_iterator_count_apply , (void * )& count ) == SUCCESS ) {
3602
- RETURN_LONG ( count ) ;
3597
+ if (spl_iterator_apply (obj , spl_iterator_count_apply , (void * )& count ) == FAILURE ) {
3598
+ return ;
3603
3599
}
3600
+
3601
+ RETURN_LONG (count );
3604
3602
}
3605
3603
/* }}} */
3606
3604
@@ -3639,12 +3637,13 @@ PHP_FUNCTION(iterator_apply)
3639
3637
3640
3638
apply_info .count = 0 ;
3641
3639
zend_fcall_info_args (& apply_info .fci , apply_info .args );
3642
- if (spl_iterator_apply (apply_info .obj , spl_iterator_func_apply , (void * )& apply_info ) == SUCCESS ) {
3643
- RETVAL_LONG (apply_info .count );
3644
- } else {
3645
- RETVAL_FALSE ;
3640
+ if (spl_iterator_apply (apply_info .obj , spl_iterator_func_apply , (void * )& apply_info ) == FAILURE ) {
3641
+ zend_fcall_info_args (& apply_info .fci , NULL );
3642
+ return ;
3646
3643
}
3644
+
3647
3645
zend_fcall_info_args (& apply_info .fci , NULL );
3646
+ RETURN_LONG (apply_info .count );
3648
3647
}
3649
3648
/* }}} */
3650
3649
0 commit comments