Skip to content

Commit 94e2f25

Browse files
TysonAndrenikic
andcommitted
Add missing opcache return types for functions in spl
(excluding spl_autoload) spl_object_id() is of the most interest to me, since I frequently call it in an application. This includes false/null types caused by wrong argument types and wrong argument counts. I can't rule out iterator_to_array returning null in spl_iterator_apply, so leave MAY_BE_NULL in. With review comments by nikic: Co-Authored-By: Nikita Popov <nikita.ppv@googlemail.com>
1 parent ced5bb7 commit 94e2f25

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

ext/opcache/Optimizer/zend_func_info.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1607,6 +1607,17 @@ static const func_info_t func_infos[] = {
16071607
F0("imagesetinterpolation", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE),
16081608
F1("imageresolution", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_LONG),
16091609

1610+
/* ext/spl */
1611+
F1("class_implements", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_STRING),
1612+
F1("class_parents", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_STRING),
1613+
F1("class_uses", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_STRING),
1614+
F0("iterator_apply", MAY_BE_NULL | MAY_BE_LONG),
1615+
F0("iterator_count", MAY_BE_FALSE | MAY_BE_LONG),
1616+
F1("iterator_to_array", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_ARRAY_OF_ANY),
1617+
F1("spl_classes", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_STRING),
1618+
F1("spl_object_hash", MAY_BE_NULL | MAY_BE_STRING),
1619+
F0("spl_object_id", MAY_BE_NULL | MAY_BE_LONG),
1620+
16101621
};
16111622

16121623
static HashTable func_info;

0 commit comments

Comments
 (0)