From: Nikita Popov Date: Thu, 2 May 2019 13:07:04 +0000 (+0200) Subject: Merge branch 'PHP-7.4' X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=79f41944babaa4d4ae4f1928fcb999feaf9a48b9;p=php Merge branch 'PHP-7.4' --- 79f41944babaa4d4ae4f1928fcb999feaf9a48b9 diff --cc Zend/zend_compile.c index af331bb3f1,6e9b42151f..a659a2a9bb --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@@ -5497,20 -5626,16 +5596,30 @@@ static void zend_compile_closure_uses(z } /* }}} */ + static void zend_compile_implicit_closure_uses(closure_info *info) + { + zend_string *var_name; + ZEND_HASH_FOREACH_STR_KEY(&info->uses, var_name) + zval zv; + ZVAL_NULL(&zv); + zend_compile_static_var_common(var_name, &zv, 0); + ZEND_HASH_FOREACH_END(); + } + +static void zend_check_magic_method_attr(uint32_t attr, const char* method, zend_bool is_static) /* {{{ */ +{ + if (is_static) { + if (!(attr & ZEND_ACC_PUBLIC) || !(attr & ZEND_ACC_STATIC)) { + zend_error(E_WARNING, "The magic method %s() must have public visibility and be static", method); + } + } else if (!(attr & ZEND_ACC_PUBLIC) || (attr & ZEND_ACC_STATIC)) { + zend_error(E_WARNING, + "The magic method %s() must have public visibility and cannot be static", + method); + } +} +/* }}} */ + void zend_begin_method_decl(zend_op_array *op_array, zend_string *name, zend_bool has_body) /* {{{ */ { zend_class_entry *ce = CG(active_class_entry);