@@ -6287,7 +6287,7 @@ static inline void php_iterable_until(INTERNAL_FUNCTION_PARAMETERS, int stop_val
6287
6287
zend_fcall_info_cache fci_cache = empty_fcall_info_cache ;
6288
6288
6289
6289
ZEND_PARSE_PARAMETERS_START (1 , 2 )
6290
- Z_PARAM_ZVAL (input )
6290
+ Z_PARAM_ITERABLE (input )
6291
6291
Z_PARAM_OPTIONAL
6292
6292
Z_PARAM_FUNC_OR_NULL (fci , fci_cache )
6293
6293
ZEND_PARSE_PARAMETERS_END ();
@@ -6296,28 +6296,24 @@ static inline void php_iterable_until(INTERNAL_FUNCTION_PARAMETERS, int stop_val
6296
6296
case IS_ARRAY :
6297
6297
php_array_until (return_value , Z_ARRVAL_P (input ), fci , fci_cache , stop_value );
6298
6298
return ;
6299
- case IS_OBJECT :
6300
- if (instanceof_function (Z_OBJCE_P (input ), zend_ce_traversable )) {
6301
- php_iterator_until_info until_info ;
6299
+ case IS_OBJECT : {
6300
+ ZEND_ASSERT (instanceof_function (Z_OBJCE_P (input ), zend_ce_traversable ));
6301
+ php_iterator_until_info until_info ;
6302
6302
6303
- until_info .obj = input ;
6304
- until_info .fci = fci ;
6305
- until_info .fcc = fci_cache ;
6303
+ until_info .obj = input ;
6304
+ until_info .fci = fci ;
6305
+ until_info .fcc = fci_cache ;
6306
6306
6307
- until_info .stop_value = stop_value ;
6308
- until_info .result = SUCCESS ;
6309
- until_info .found = 0 ;
6307
+ until_info .stop_value = stop_value ;
6308
+ until_info .result = SUCCESS ;
6309
+ until_info .found = 0 ;
6310
6310
6311
- if (spl_iterator_apply (until_info .obj , php_traversable_func_until , (void * )& until_info ) == SUCCESS && until_info .result == SUCCESS ) {
6312
- RETURN_BOOL (!(until_info .found ^ stop_value ));
6313
- }
6314
- return ;
6311
+ if (spl_iterator_apply (until_info .obj , php_traversable_func_until , (void * )& until_info ) == SUCCESS && until_info .result == SUCCESS ) {
6312
+ RETURN_BOOL (!(until_info .found ^ stop_value ));
6315
6313
}
6316
- /* fallthrough */
6317
- default :
6318
- zend_argument_type_error (1 , "must be of type iterable, %s given" , zend_zval_type_name (input ));
6319
- RETURN_THROWS ();
6320
- break ;
6314
+ return ;
6315
+ }
6316
+ EMPTY_SWITCH_DEFAULT_CASE ();
6321
6317
}
6322
6318
}
6323
6319
0 commit comments