Skip to content

Commit ac356ba

Browse files
committed
Merge branch 'PHP-7.4' of git://github.com/php/php-src into PHP-7.4
2 parents c53da9b + 4de8503 commit ac356ba

File tree

3 files changed

+20
-13
lines changed

3 files changed

+20
-13
lines changed

ext/opcache/Optimizer/zend_func_info.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,7 @@ static const func_info_t func_infos[] = {
412412
F0("proc_nice", MAY_BE_FALSE | MAY_BE_TRUE),
413413
#endif
414414
F0("rand", MAY_BE_NULL | MAY_BE_LONG),
415+
F1("random_bytes", MAY_BE_STRING),
415416
F0("srand", MAY_BE_NULL),
416417
F0("getrandmax", MAY_BE_NULL | MAY_BE_LONG),
417418
F0("mt_rand", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),
@@ -848,6 +849,8 @@ static const func_info_t func_infos[] = {
848849
F1("array_chunk", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
849850
F1("array_combine", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
850851
F0("array_key_exists", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
852+
FN("array_key_first", MAY_BE_NULL | MAY_BE_LONG | MAY_BE_STRING),
853+
FN("array_key_last", MAY_BE_NULL | MAY_BE_LONG | MAY_BE_STRING),
851854
F1("pos", UNKNOWN_INFO),
852855
F0("sizeof", MAY_BE_NULL | MAY_BE_LONG),
853856
F0("key_exists", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
@@ -1207,9 +1210,12 @@ static const func_info_t func_infos[] = {
12071210

12081211
/* ext/hash */
12091212
F1("hash", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
1213+
F0("hash_equals", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
12101214
F1("hash_file", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
12111215
F1("hash_hmac", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
1216+
F1("hash_hmac_algos", MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
12121217
F1("hash_hmac_file", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
1218+
F1("hash_hkdf", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
12131219
F1("hash_init", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_OBJECT),
12141220
F0("hash_update", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
12151221
F0("hash_update_stream", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_LONG),

ext/spl/php_spl.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@ PHP_FUNCTION(class_uses)
237237
Return an array containing the names of all clsses and interfaces defined in SPL */
238238
PHP_FUNCTION(spl_classes)
239239
{
240+
if (zend_parse_parameters_none() == FAILURE) {
241+
return;
242+
}
243+
240244
array_init(return_value);
241245

242246
SPL_LIST_CLASSES(return_value, 0, 0, 0)
@@ -983,11 +987,9 @@ static const zend_function_entry spl_functions[] = {
983987
PHP_FE(class_uses, arginfo_class_uses)
984988
PHP_FE(spl_object_hash, arginfo_spl_object_hash)
985989
PHP_FE(spl_object_id, arginfo_spl_object_id)
986-
#ifdef SPL_ITERATORS_H
987990
PHP_FE(iterator_to_array, arginfo_iterator_to_array)
988991
PHP_FE(iterator_count, arginfo_iterator)
989992
PHP_FE(iterator_apply, arginfo_iterator_apply)
990-
#endif /* SPL_ITERATORS_H */
991993
PHP_FE_END
992994
};
993995
/* }}} */

ext/spl/spl_iterators.c

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3573,11 +3573,7 @@ PHP_FUNCTION(iterator_to_array)
35733573
}
35743574

35753575
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);
35813577
} /* }}} */
35823578

35833579
static int spl_iterator_count_apply(zend_object_iterator *iter, void *puser) /* {{{ */
@@ -3598,9 +3594,11 @@ PHP_FUNCTION(iterator_count)
35983594
RETURN_FALSE;
35993595
}
36003596

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;
36033599
}
3600+
3601+
RETURN_LONG(count);
36043602
}
36053603
/* }}} */
36063604

@@ -3639,12 +3637,13 @@ PHP_FUNCTION(iterator_apply)
36393637

36403638
apply_info.count = 0;
36413639
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;
36463643
}
3644+
36473645
zend_fcall_info_args(&apply_info.fci, NULL);
3646+
RETURN_LONG(apply_info.count);
36483647
}
36493648
/* }}} */
36503649

0 commit comments

Comments
 (0)