]> granicus.if.org Git - php/commitdiff
Remove special handling of zero-arg funcs in func_info
authorNikita Popov <nikita.ppv@gmail.com>
Mon, 27 May 2019 15:16:56 +0000 (17:16 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 27 May 2019 15:16:56 +0000 (17:16 +0200)
In PHP 8 we always throw on zpp failure, so we can always return the
type for the valid argument case only. We'll want to also adjust the
return type listings based on that (and drop MAY_BE_NULL/MAY_BE_FALSE
where possible).

ext/opcache/Optimizer/zend_func_info.c

index beb99fc0222c58245d0e293634e19b7852cdcc84..21cab6b1f9d8ffc2febe6f47e633e868fed6a792 100644 (file)
@@ -1620,15 +1620,6 @@ uint32_t zend_get_func_info(const zend_call_info *call_info, const zend_ssa *ssa
                                ret = MAY_BE_NULL;
                        } else if (info->info_func) {
                                ret = info->info_func(call_info, ssa);
-                       } else if (/*callee_func->common.arg_info && */
-                                       callee_func->common.num_args == 0 &&
-                                       callee_func->common.required_num_args == 0 &&
-                                       !(callee_func->common.fn_flags & ZEND_ACC_VARIADIC)) {
-                               if (call_info->num_args == 0) {
-                                       ret = info->info;
-                               } else {
-                                       ret = FUNC_MAY_WARN | MAY_BE_NULL;
-                               }
                        } else {
                                ret = info->info;
                        }