Skip to content

Commit 4de8503

Browse files
TysonAndrenikic
authored andcommitted
Add missing opcache return info for ext/standard.
array_key_first/last returns null for invalid args, wrong argument counts, and empty arrays. random_bytes returns a string or throws.
1 parent 1a905bc commit 4de8503

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ext/opcache/Optimizer/zend_func_info.c

Lines changed: 3 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),

0 commit comments

Comments
 (0)