diff options
author | Tyson Andre <tysonandre775@hotmail.com> | 2019-09-02 22:33:30 -0400 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-09-04 11:12:41 +0200 |
commit | 94e2f25f076734a38b1c046e06459d404a7650cf (patch) | |
tree | 2dce5bbe28973766e955ee437920fbb38595a0c9 | |
parent | ced5bb7d88b48dbc9b98a2d24e3ee586fe65651a (diff) | |
download | php-git-94e2f25f076734a38b1c046e06459d404a7650cf.tar.gz |
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>
-rw-r--r-- | ext/opcache/Optimizer/zend_func_info.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ext/opcache/Optimizer/zend_func_info.c b/ext/opcache/Optimizer/zend_func_info.c index 9cae08701e..c34c81f6f0 100644 --- a/ext/opcache/Optimizer/zend_func_info.c +++ b/ext/opcache/Optimizer/zend_func_info.c @@ -1607,6 +1607,17 @@ static const func_info_t func_infos[] = { F0("imagesetinterpolation", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE), F1("imageresolution", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_TRUE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_LONG), + /* ext/spl */ + F1("class_implements", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_STRING), + F1("class_parents", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_STRING), + F1("class_uses", MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_STRING), + F0("iterator_apply", MAY_BE_NULL | MAY_BE_LONG), + F0("iterator_count", MAY_BE_FALSE | MAY_BE_LONG), + 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), + F1("spl_classes", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_STRING), + F1("spl_object_hash", MAY_BE_NULL | MAY_BE_STRING), + F0("spl_object_id", MAY_BE_NULL | MAY_BE_LONG), + }; static HashTable func_info; |