@@ -3532,11 +3532,7 @@ PHP_FUNCTION(iterator_to_array)
3532
3532
}
3533
3533
3534
3534
array_init (return_value );
3535
-
3536
- if (spl_iterator_apply (obj , use_keys ? spl_iterator_to_array_apply : spl_iterator_to_values_apply , (void * )return_value ) != SUCCESS ) {
3537
- zval_ptr_dtor (return_value );
3538
- RETURN_NULL ();
3539
- }
3535
+ spl_iterator_apply (obj , use_keys ? spl_iterator_to_array_apply : spl_iterator_to_values_apply , (void * )return_value );
3540
3536
} /* }}} */
3541
3537
3542
3538
static int spl_iterator_count_apply (zend_object_iterator * iter , void * puser ) /* {{{ */
@@ -3557,9 +3553,11 @@ PHP_FUNCTION(iterator_count)
3557
3553
RETURN_FALSE ;
3558
3554
}
3559
3555
3560
- if (spl_iterator_apply (obj , spl_iterator_count_apply , (void * )& count ) == SUCCESS ) {
3561
- RETURN_LONG ( count ) ;
3556
+ if (spl_iterator_apply (obj , spl_iterator_count_apply , (void * )& count ) == FAILURE ) {
3557
+ return ;
3562
3558
}
3559
+
3560
+ RETURN_LONG (count );
3563
3561
}
3564
3562
/* }}} */
3565
3563
@@ -3598,12 +3596,13 @@ PHP_FUNCTION(iterator_apply)
3598
3596
3599
3597
apply_info .count = 0 ;
3600
3598
zend_fcall_info_args (& apply_info .fci , apply_info .args );
3601
- if (spl_iterator_apply (apply_info .obj , spl_iterator_func_apply , (void * )& apply_info ) == SUCCESS ) {
3602
- RETVAL_LONG (apply_info .count );
3603
- } else {
3604
- RETVAL_FALSE ;
3599
+ if (spl_iterator_apply (apply_info .obj , spl_iterator_func_apply , (void * )& apply_info ) == FAILURE ) {
3600
+ zend_fcall_info_args (& apply_info .fci , NULL );
3601
+ return ;
3605
3602
}
3603
+
3606
3604
zend_fcall_info_args (& apply_info .fci , NULL );
3605
+ RETURN_LONG (apply_info .count );
3607
3606
}
3608
3607
/* }}} */
3609
3608
0 commit comments