]> granicus.if.org Git - php/commitdiff
Get rid of ZEND_ACC_CTOR, ZEND_ACC_DTOR and ZEND_ACC_IMPLEMENTED_ABSTRACT
authorDmitry Stogov <dmitry@zend.com>
Wed, 5 Sep 2018 10:16:10 +0000 (13:16 +0300)
committerDmitry Stogov <dmitry@zend.com>
Wed, 5 Sep 2018 10:16:10 +0000 (13:16 +0300)
20 files changed:
UPGRADING.INTERNALS
Zend/zend_API.c
Zend/zend_builtin_functions.c
Zend/zend_compile.c
Zend/zend_compile.h
Zend/zend_inheritance.c
Zend/zend_interfaces.c
ext/curl/curl_file.c
ext/date/php_date.c
ext/hash/hash.c
ext/intl/collator/collator_class.c
ext/intl/converter/converter.c
ext/intl/dateformat/dateformat_class.c
ext/intl/formatter/formatter_class.c
ext/intl/msgformat/msgformat_class.c
ext/intl/resourcebundle/resourcebundle_class.c
ext/intl/spoofchecker/spoofchecker_class.c
ext/intl/transliterator/transliterator_class.c
ext/reflection/php_reflection.c
ext/sqlite3/sqlite3.c

index 9981b56f8b3ea64d11ca0522a863f4ef43931901..882a8a650d90675f11c91de39d246986f8b2cc6d 100644 (file)
@@ -3,6 +3,7 @@ PHP 7.4 INTERNALS UPGRADE NOTES
 1. Internal API changes
   a. php_sys_symlink() and php_sys_link()
   b. zend_lookup_class_ex() and zend_fetch_class_by_name()
+  c. Function flags
 
 2. Build system changes
   a. Unix build system changes
@@ -22,6 +23,13 @@ PHP 7.4 INTERNALS UPGRADE NOTES
     changed to accept optional lower-case class name as zend_string*,
     instead of zval*.
 
+ c. Function flags changes
+    - ZEND_ACC_CTOR and ZEND_ACC_DTOR are removed. It's pissible to check if
+      method is a constructor/destructor using the following condintion
+      (func->commpon.scope->constructor == func).
+    - ZEND_ACC_IMPLEMENTED_ABSTRACT is removed (it was used only internally
+      during inheritance).
+
 ========================
 2. Build system changes
 ========================
index 87d62729802c486a8fbcdfd73eea3b8a8e3d6055..0cf6ef0c082c7425828e82c79235ecf0e422170e 100644 (file)
@@ -2410,14 +2410,12 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
                scope->__isset = __isset;
                scope->__debugInfo = __debugInfo;
                if (ctor) {
-                       ctor->common.fn_flags |= ZEND_ACC_CTOR;
                        if (ctor->common.fn_flags & ZEND_ACC_STATIC) {
                                zend_error(error_type, "Constructor %s::%s() cannot be static", ZSTR_VAL(scope->name), ZSTR_VAL(ctor->common.function_name));
                        }
                        ctor->common.fn_flags &= ~ZEND_ACC_ALLOW_STATIC;
                }
                if (dtor) {
-                       dtor->common.fn_flags |= ZEND_ACC_DTOR;
                        if (dtor->common.fn_flags & ZEND_ACC_STATIC) {
                                zend_error(error_type, "Destructor %s::%s() cannot be static", ZSTR_VAL(scope->name), ZSTR_VAL(dtor->common.function_name));
                        }
@@ -2477,11 +2475,11 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
                        }
                }
 
-               if (ctor && ctor->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE && ctor->common.fn_flags & ZEND_ACC_CTOR) {
+               if (ctor && (ctor->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE)) {
                        zend_error_noreturn(E_CORE_ERROR, "Constructor %s::%s() cannot declare a return type", ZSTR_VAL(scope->name), ZSTR_VAL(ctor->common.function_name));
                }
 
-               if (dtor && dtor->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE && dtor->common.fn_flags & ZEND_ACC_DTOR) {
+               if (dtor && (dtor->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE)) {
                        zend_error_noreturn(E_CORE_ERROR, "Destructor %s::%s() cannot declare a return type", ZSTR_VAL(scope->name), ZSTR_VAL(dtor->common.function_name));
                }
 
index 5b7ecd8c866dd1c8e41c0b26c9f41ea1ce03a6b7..d83169cac8aded9c9d04734eb1e755ef52894180 100644 (file)
@@ -1300,7 +1300,7 @@ ZEND_FUNCTION(get_class_methods)
                        if (!key) {
                                ZVAL_STR_COPY(&method_name, mptr->common.function_name);
                                zend_hash_next_index_insert_new(Z_ARRVAL_P(return_value), &method_name);
-                       } else if ((mptr->common.fn_flags & ZEND_ACC_CTOR) == 0 ||
+                       } else if (mptr->common.scope->constructor != mptr ||
                            mptr->common.scope == ce ||
                            zend_binary_strcasecmp(ZSTR_VAL(key), ZSTR_LEN(key), ZSTR_VAL(mptr->common.function_name), len) == 0) {
 
index 5831f6605c09a747edfc5dbd409ce1dd2cee4d48..4764329b57d42e815005aab7b68b88f3ebf63d0d 100644 (file)
@@ -6296,7 +6296,6 @@ void zend_compile_class_decl(zend_ast *ast, zend_bool toplevel) /* {{{ */
        }
 
        if (ce->constructor) {
-               ce->constructor->common.fn_flags |= ZEND_ACC_CTOR;
                if (ce->constructor->common.fn_flags & ZEND_ACC_STATIC) {
                        zend_error_noreturn(E_COMPILE_ERROR, "Constructor %s::%s() cannot be static",
                                ZSTR_VAL(ce->name), ZSTR_VAL(ce->constructor->common.function_name));
@@ -6308,7 +6307,6 @@ void zend_compile_class_decl(zend_ast *ast, zend_bool toplevel) /* {{{ */
                }
        }
        if (ce->destructor) {
-               ce->destructor->common.fn_flags |= ZEND_ACC_DTOR;
                if (ce->destructor->common.fn_flags & ZEND_ACC_STATIC) {
                        zend_error_noreturn(E_COMPILE_ERROR, "Destructor %s::%s() cannot be static",
                                ZSTR_VAL(ce->name), ZSTR_VAL(ce->destructor->common.function_name));
index 96f09878bbb9bf7f574db5f406d380a5c8e4d35c..b7f7014281962422f83a7c50c34374ee867edff5 100644 (file)
@@ -271,18 +271,11 @@ typedef struct _zend_oparray_context {
 /* Abstarct method                                        |     |     |     */
 #define ZEND_ACC_ABSTRACT                (1 <<  1) /*     |  X  |     |     */
 /*                                                        |     |     |     */
-/* TODO: used only during inheritance ???                 |     |     |     */
-#define ZEND_ACC_IMPLEMENTED_ABSTRACT    (1 <<  3) /*     |  X  |     |     */
-/*                                                        |     |     |     */
 #define ZEND_ACC_FAKE_CLOSURE            (1 <<  6) /*     |  X  |     |     */
 /*                                                        |     |     |     */
 /* method flag used by Closure::__invoke()                |     |     |     */
 #define ZEND_ACC_USER_ARG_INFO           (1 <<  7) /*     |  X  |     |     */
 /*                                                        |     |     |     */
-/* method flags (special method detection)                |     |     |     */
-#define ZEND_ACC_CTOR                    (1 << 13) /*     |  X  |     |     */
-#define ZEND_ACC_DTOR                    (1 << 14) /*     |  X  |     |     */
-/*                                                        |     |     |     */
 /* "main" op_array with                                   |     |     |     */
 /* ZEND_DECLARE_INHERITED_CLASS_DELAYED opcodes           |     |     |     */
 #define ZEND_ACC_EARLY_BINDING           (1 << 15) /*     |  X  |     |     */
index d9711977bf62c7576b30591ad7d5d5cea3efa31b..c6a89754c958e52478c19b98c2317b377e3956a9 100644 (file)
@@ -90,22 +90,24 @@ static zend_function *zend_duplicate_function(zend_function *func, zend_class_en
 
 static void do_inherit_parent_constructor(zend_class_entry *ce) /* {{{ */
 {
-       ZEND_ASSERT(ce->parent != NULL);
+       zend_class_entry *parent = ce->parent;
+
+       ZEND_ASSERT(parent != NULL);
 
        /* You cannot change create_object */
-       ce->create_object = ce->parent->create_object;
+       ce->create_object = parent->create_object;
 
        /* Inherit special functions if needed */
        if (EXPECTED(!ce->get_iterator)) {
-               ce->get_iterator = ce->parent->get_iterator;
+               ce->get_iterator = parent->get_iterator;
        }
-       if (EXPECTED(!ce->iterator_funcs_ptr) && UNEXPECTED(ce->parent->iterator_funcs_ptr)) {
+       if (EXPECTED(!ce->iterator_funcs_ptr) && UNEXPECTED(parent->iterator_funcs_ptr)) {
                if (ce->type == ZEND_INTERNAL_CLASS) {
                        ce->iterator_funcs_ptr = calloc(1, sizeof(zend_class_iterator_funcs));
-                       if (ce->parent->iterator_funcs_ptr->zf_new_iterator) {
+                       if (parent->iterator_funcs_ptr->zf_new_iterator) {
                                ce->iterator_funcs_ptr->zf_new_iterator = zend_hash_str_find_ptr(&ce->function_table, "getiterator", sizeof("getiterator") - 1);
                        }
-                       if (ce->parent->iterator_funcs_ptr->zf_current) {
+                       if (parent->iterator_funcs_ptr->zf_current) {
                                ce->iterator_funcs_ptr->zf_rewind = zend_hash_str_find_ptr(&ce->function_table, "rewind", sizeof("rewind") - 1);
                                ce->iterator_funcs_ptr->zf_valid = zend_hash_str_find_ptr(&ce->function_table, "valid", sizeof("valid") - 1);
                                ce->iterator_funcs_ptr->zf_key = zend_hash_str_find_ptr(&ce->function_table, "key", sizeof("key") - 1);
@@ -118,52 +120,52 @@ static void do_inherit_parent_constructor(zend_class_entry *ce) /* {{{ */
                }
        }
        if (EXPECTED(!ce->__get)) {
-               ce->__get = ce->parent->__get;
+               ce->__get = parent->__get;
        }
        if (EXPECTED(!ce->__set)) {
-               ce->__set = ce->parent->__set;
+               ce->__set = parent->__set;
        }
        if (EXPECTED(!ce->__unset)) {
-               ce->__unset = ce->parent->__unset;
+               ce->__unset = parent->__unset;
        }
        if (EXPECTED(!ce->__isset)) {
-               ce->__isset = ce->parent->__isset;
+               ce->__isset = parent->__isset;
        }
        if (EXPECTED(!ce->__call)) {
-               ce->__call = ce->parent->__call;
+               ce->__call = parent->__call;
        }
        if (EXPECTED(!ce->__callstatic)) {
-               ce->__callstatic = ce->parent->__callstatic;
+               ce->__callstatic = parent->__callstatic;
        }
        if (EXPECTED(!ce->__tostring)) {
-               ce->__tostring = ce->parent->__tostring;
+               ce->__tostring = parent->__tostring;
        }
        if (EXPECTED(!ce->clone)) {
-               ce->clone = ce->parent->clone;
+               ce->clone = parent->clone;
        }
        if (EXPECTED(!ce->serialize)) {
-               ce->serialize = ce->parent->serialize;
+               ce->serialize = parent->serialize;
        }
        if (EXPECTED(!ce->unserialize)) {
-               ce->unserialize = ce->parent->unserialize;
+               ce->unserialize = parent->unserialize;
        }
        if (!ce->destructor) {
-               ce->destructor = ce->parent->destructor;
+               ce->destructor = parent->destructor;
        }
        if (EXPECTED(!ce->__debugInfo)) {
-               ce->__debugInfo = ce->parent->__debugInfo;
+               ce->__debugInfo = parent->__debugInfo;
        }
 
        if (ce->constructor) {
-               if (ce->parent->constructor && UNEXPECTED(ce->parent->constructor->common.fn_flags & ZEND_ACC_FINAL)) {
+               if (parent->constructor && UNEXPECTED(parent->constructor->common.fn_flags & ZEND_ACC_FINAL)) {
                        zend_error_noreturn(E_ERROR, "Cannot override final %s::%s() with %s::%s()",
-                               ZSTR_VAL(ce->parent->name), ZSTR_VAL(ce->parent->constructor->common.function_name),
+                               ZSTR_VAL(parent->name), ZSTR_VAL(parent->constructor->common.function_name),
                                ZSTR_VAL(ce->name), ZSTR_VAL(ce->constructor->common.function_name));
                }
                return;
        }
 
-       ce->constructor = ce->parent->constructor;
+       ce->constructor = parent->constructor;
 }
 /* }}} */
 
@@ -284,14 +286,14 @@ static zend_bool zend_do_perform_implementation_check(const zend_function *fe, c
         * we still need to do the arg number checks.  We are only willing to ignore this for internal
         * functions because extensions don't always define arg_info.
         */
-       if (!proto || (!proto->common.arg_info && proto->common.type != ZEND_USER_FUNCTION)) {
+       if (!proto->common.arg_info && proto->common.type != ZEND_USER_FUNCTION) {
                return 1;
        }
 
        /* Checks for constructors only if they are declared in an interface,
         * or explicitly marked as abstract
         */
-       if ((fe->common.fn_flags & ZEND_ACC_CTOR)
+       if ((fe->common.scope->constructor == fe)
                && ((proto->common.scope->ce_flags & ZEND_ACC_INTERFACE) == 0
                        && (proto->common.fn_flags & ZEND_ACC_ABSTRACT) == 0)) {
                return 1;
@@ -584,55 +586,64 @@ static void do_inheritance_check_on_method(zend_function *child, zend_function *
                zend_error_noreturn(E_COMPILE_ERROR, "Cannot make non abstract method %s::%s() abstract in class %s", ZEND_FN_SCOPE_NAME(parent), ZSTR_VAL(child->common.function_name), ZEND_FN_SCOPE_NAME(child));
        }
 
-       /* Prevent derived classes from restricting access that was available in parent classes (except deriving from non-abstract ctors) */
-       if (UNEXPECTED((!(child_flags & ZEND_ACC_CTOR) || (parent_flags & (ZEND_ACC_ABSTRACT | ZEND_ACC_IMPLEMENTED_ABSTRACT))) &&
-               (child_flags & ZEND_ACC_PPP_MASK) > (parent_flags & ZEND_ACC_PPP_MASK))) {
-               zend_error_noreturn(E_COMPILE_ERROR, "Access level to %s::%s() must be %s (as in class %s)%s", ZEND_FN_SCOPE_NAME(child), ZSTR_VAL(child->common.function_name), zend_visibility_string(parent_flags), ZEND_FN_SCOPE_NAME(parent), (parent_flags&ZEND_ACC_PUBLIC) ? "" : " or weaker");
-       }
-
        if ((child_flags & ZEND_ACC_PRIVATE) < (parent_flags & (ZEND_ACC_PRIVATE|ZEND_ACC_CHANGED))) {
                child->common.fn_flags |= ZEND_ACC_CHANGED;
        }
 
-       if (parent_flags & ZEND_ACC_PRIVATE) {
-               child->common.prototype = NULL;
-       } else if (parent_flags & ZEND_ACC_ABSTRACT) {
-               child->common.fn_flags |= ZEND_ACC_IMPLEMENTED_ABSTRACT;
-               child->common.prototype = parent;
-       } else if (!(parent->common.fn_flags & ZEND_ACC_CTOR)) {
-               child->common.prototype = parent->common.prototype ? parent->common.prototype : parent;
-       } else if (parent->common.prototype && (parent->common.prototype->common.scope->ce_flags & ZEND_ACC_INTERFACE)) {
-               /* ctors only have a prototype if it comes from an interface */
-               child->common.prototype = parent->common.prototype ? parent->common.prototype : parent;
-               /* and if that is the case, we want to check inheritance against it */
-               parent = child->common.prototype;
-       }
-
-       if (UNEXPECTED(!zend_do_perform_implementation_check(child, parent))) {
-               int error_level;
-               const char *error_verb;
-               zend_string *method_prototype = zend_get_function_declaration(parent);
-               zend_string *child_prototype = zend_get_function_declaration(child);
-
-               if (child->common.prototype && (
-                       child->common.prototype->common.fn_flags & ZEND_ACC_ABSTRACT
-               )) {
-                       error_level = E_COMPILE_ERROR;
-                       error_verb = "must";
-               } else if ((parent->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) &&
-                   (!(child->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) ||
-                           !zend_do_perform_type_hint_check(child, child->common.arg_info - 1, parent, parent->common.arg_info - 1) ||
-                           (ZEND_TYPE_ALLOW_NULL(child->common.arg_info[-1].type) && !ZEND_TYPE_ALLOW_NULL(parent->common.arg_info[-1].type)))) {
-                       error_level = E_COMPILE_ERROR;
-                       error_verb = "must";
-               } else {
-                       error_level = E_WARNING;
-                       error_verb = "should";
+       do {
+               if (!(parent_flags & ZEND_ACC_PRIVATE)) {
+                       if (parent_flags & ZEND_ACC_ABSTRACT) {
+                               child->common.prototype = parent;
+                       } else {
+                               zend_function *proto = parent->common.prototype;
+
+                               if (parent->common.scope->constructor != parent) {
+                                       child->common.prototype = proto ? proto : parent;
+                               } else if (proto) {
+                                       if (proto->common.scope->ce_flags & ZEND_ACC_INTERFACE) {
+                                               /* ctors only have a prototype if it comes from an interface */
+                                               child->common.prototype = proto;
+                                               /* and if that is the case, we want to check inheritance against it */
+                                               parent = proto;
+                                       } else if (!(proto->common.fn_flags & ZEND_ACC_ABSTRACT)) {
+                                               break;
+                                       }
+                               } else {
+                                       break;
+                               }
+                       }
+                       /* Prevent derived classes from restricting access that was available in parent classes (except deriving from non-abstract ctors) */
+                       if ((child_flags & ZEND_ACC_PPP_MASK) > (parent_flags & ZEND_ACC_PPP_MASK)) {
+                               zend_error_noreturn(E_COMPILE_ERROR, "Access level to %s::%s() must be %s (as in class %s)%s", ZEND_FN_SCOPE_NAME(child), ZSTR_VAL(child->common.function_name), zend_visibility_string(parent_flags), ZEND_FN_SCOPE_NAME(parent), (parent_flags&ZEND_ACC_PUBLIC) ? "" : " or weaker");
+                       }
+
+                       if (UNEXPECTED(!zend_do_perform_implementation_check(child, parent))) {
+                               int error_level;
+                               const char *error_verb;
+                               zend_string *method_prototype = zend_get_function_declaration(parent);
+                               zend_string *child_prototype = zend_get_function_declaration(child);
+
+                               if (child->common.prototype && (
+                                       child->common.prototype->common.fn_flags & ZEND_ACC_ABSTRACT
+                               )) {
+                                       error_level = E_COMPILE_ERROR;
+                                       error_verb = "must";
+                               } else if ((parent->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) &&
+                                  (!(child->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) ||
+                                           !zend_do_perform_type_hint_check(child, child->common.arg_info - 1, parent, parent->common.arg_info - 1) ||
+                                           (ZEND_TYPE_ALLOW_NULL(child->common.arg_info[-1].type) && !ZEND_TYPE_ALLOW_NULL(parent->common.arg_info[-1].type)))) {
+                                       error_level = E_COMPILE_ERROR;
+                                       error_verb = "must";
+                               } else {
+                                       error_level = E_WARNING;
+                                       error_verb = "should";
+                               }
+                               zend_error(error_level, "Declaration of %s %s be compatible with %s", ZSTR_VAL(child_prototype), error_verb, ZSTR_VAL(method_prototype));
+                               zend_string_efree(child_prototype);
+                               zend_string_efree(method_prototype);
+                       }
                }
-               zend_error(error_level, "Declaration of %s %s be compatible with %s", ZSTR_VAL(child_prototype), error_verb, ZSTR_VAL(method_prototype));
-               zend_string_efree(child_prototype);
-               zend_string_efree(method_prototype);
-       }
+       } while (0);
 }
 /* }}} */
 
@@ -1202,11 +1213,10 @@ static void zend_add_magic_methods(zend_class_entry* ce, zend_string* mname, zen
                zend_string *lowercase_name = zend_string_tolower(ce->name);
                lowercase_name = zend_new_interned_string(lowercase_name);
                if (!memcmp(ZSTR_VAL(mname), ZSTR_VAL(lowercase_name), ZSTR_LEN(mname))) {
-                       if (ce->constructor  && (!ce->parent || ce->constructor != ce->parent->constructor)) {
+                       if (ce->constructor && (!ce->parent || ce->constructor != ce->parent->constructor)) {
                                zend_error_noreturn(E_COMPILE_ERROR, "%s has colliding constructor definitions coming from traits", ZSTR_VAL(ce->name));
                        }
                        ce->constructor = fe;
-                       fe->common.fn_flags |= ZEND_ACC_CTOR;
                }
                zend_string_release_ex(lowercase_name, 0);
        } else if (ZSTR_VAL(mname)[0] != '_' || ZSTR_VAL(mname)[1] != '_') {
@@ -1217,9 +1227,9 @@ static void zend_add_magic_methods(zend_class_entry* ce, zend_string* mname, zen
                if (ce->constructor && (!ce->parent || ce->constructor != ce->parent->constructor)) {
                        zend_error_noreturn(E_COMPILE_ERROR, "%s has colliding constructor definitions coming from traits", ZSTR_VAL(ce->name));
                }
-               ce->constructor = fe; fe->common.fn_flags |= ZEND_ACC_CTOR;
+               ce->constructor = fe;
        } else if (zend_string_equals_literal(mname, ZEND_DESTRUCTOR_FUNC_NAME)) {
-               ce->destructor = fe; fe->common.fn_flags |= ZEND_ACC_DTOR;
+               ce->destructor = fe;
        } else if (zend_string_equals_literal(mname, ZEND_GET_FUNC_NAME)) {
                ce->__get = fe;
                ce->ce_flags |= ZEND_ACC_USE_GUARDS;
@@ -1903,7 +1913,7 @@ static void zend_verify_abstract_class_function(zend_function *fn, zend_abstract
                if (ai->cnt < MAX_ABSTRACT_INFO_CNT) {
                        ai->afn[ai->cnt] = fn;
                }
-               if (fn->common.fn_flags & ZEND_ACC_CTOR) {
+               if (fn->common.scope->constructor == fn) {
                        if (!ai->ctor) {
                                ai->cnt++;
                                ai->ctor = 1;
index cf92cbf4d7978c7c2636f2d214381bb071f60a91..64d46c75e26a9045744a89861cafcb4c2d24588d 100644 (file)
@@ -548,7 +548,7 @@ ZEND_END_ARG_INFO()
 
 static const zend_function_entry zend_funcs_serializable[] = {
        ZEND_ABSTRACT_ME(serializable, serialize,   NULL)
-       ZEND_FENTRY(unserialize, NULL, arginfo_serializable_serialize, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT|ZEND_ACC_CTOR)
+       ZEND_FENTRY(unserialize, NULL, arginfo_serializable_serialize, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT)
        ZEND_FE_END
 };
 
index f6657a17a85edddedab08a5c5c32846588d26f39..eca7741f17644dfdb18292dcb3a1a09f08f3c07f 100644 (file)
@@ -152,7 +152,7 @@ ZEND_END_ARG_INFO()
 
 
 static const zend_function_entry curlfile_funcs[] = {
-       PHP_ME(CURLFile,                        __construct,        arginfo_curlfile_create, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC)
+       PHP_ME(CURLFile,                        __construct,        arginfo_curlfile_create, ZEND_ACC_PUBLIC)
        PHP_ME(CURLFile,                        getFilename,        NULL, ZEND_ACC_PUBLIC)
        PHP_ME(CURLFile,                        getMimeType,        NULL, ZEND_ACC_PUBLIC)
        PHP_ME(CURLFile,                        setMimeType,        arginfo_curlfile_name, ZEND_ACC_PUBLIC)
index 507bdb4738bba5d35ebdc7fa9cca9dac46fb3277..d1f94dcd2211d1ebe75497df4ddfd2182a4cbf4e 100644 (file)
@@ -477,7 +477,7 @@ static const zend_function_entry date_funcs_interface[] = {
 };
 
 static const zend_function_entry date_funcs_date[] = {
-       PHP_ME(DateTime,                        __construct,            arginfo_date_create, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC)
+       PHP_ME(DateTime,                        __construct,            arginfo_date_create, ZEND_ACC_PUBLIC)
        PHP_ME(DateTime,                        __wakeup,                       NULL, ZEND_ACC_PUBLIC)
        PHP_ME(DateTime,                        __set_state,            arginfo_date_set_state, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
        PHP_ME(DateTime,                        createFromImmutable,    arginfo_date_method_create_from_immutable, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
@@ -500,7 +500,7 @@ static const zend_function_entry date_funcs_date[] = {
 };
 
 static const zend_function_entry date_funcs_immutable[] = {
-       PHP_ME(DateTimeImmutable, __construct,   arginfo_date_create, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC)
+       PHP_ME(DateTimeImmutable, __construct,   arginfo_date_create, ZEND_ACC_PUBLIC)
        PHP_ME(DateTime, __wakeup,       NULL, ZEND_ACC_PUBLIC)
        PHP_ME(DateTimeImmutable, __set_state,   arginfo_date_set_state, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
        PHP_ME_MAPPING(createFromFormat, date_create_immutable_from_format, arginfo_date_create_from_format, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
@@ -523,7 +523,7 @@ static const zend_function_entry date_funcs_immutable[] = {
 };
 
 static const zend_function_entry date_funcs_timezone[] = {
-       PHP_ME(DateTimeZone,              __construct,                 arginfo_timezone_open, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC)
+       PHP_ME(DateTimeZone,              __construct,                 arginfo_timezone_open, ZEND_ACC_PUBLIC)
        PHP_ME(DateTimeZone,              __wakeup,                    NULL, ZEND_ACC_PUBLIC)
        PHP_ME(DateTimeZone,              __set_state,                 arginfo_date_set_state, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
        PHP_ME_MAPPING(getName,           timezone_name_get,           arginfo_timezone_method_name_get, 0)
@@ -536,7 +536,7 @@ static const zend_function_entry date_funcs_timezone[] = {
 };
 
 static const zend_function_entry date_funcs_interval[] = {
-       PHP_ME(DateInterval,              __construct,                 arginfo_date_interval_construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC)
+       PHP_ME(DateInterval,              __construct,                 arginfo_date_interval_construct, ZEND_ACC_PUBLIC)
        PHP_ME(DateInterval,              __wakeup,                    NULL, ZEND_ACC_PUBLIC)
        PHP_ME(DateInterval,              __set_state,                 arginfo_date_set_state, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
        PHP_ME_MAPPING(format,            date_interval_format,        arginfo_date_method_interval_format, 0)
@@ -545,7 +545,7 @@ static const zend_function_entry date_funcs_interval[] = {
 };
 
 static const zend_function_entry date_funcs_period[] = {
-       PHP_ME(DatePeriod,                __construct,                 arginfo_date_period_construct, ZEND_ACC_CTOR|ZEND_ACC_PUBLIC)
+       PHP_ME(DatePeriod,                __construct,                 arginfo_date_period_construct, ZEND_ACC_PUBLIC)
        PHP_ME(DatePeriod,                __wakeup,                    NULL, ZEND_ACC_PUBLIC)
        PHP_ME(DatePeriod,                __set_state,                 arginfo_date_set_state, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
        PHP_ME(DatePeriod,                getStartDate,                NULL, ZEND_ACC_PUBLIC)
index 6bd52e25967afa12a9965363819d3f9d4f399c07..d3b4a07c5abc33759f1f2346de22b6df811ad213 100644 (file)
@@ -888,7 +888,7 @@ static PHP_METHOD(HashContext, __construct) {
 /* }}} */
 
 static const zend_function_entry php_hashcontext_methods[] = {
-       PHP_ME(HashContext, __construct, NULL, ZEND_ACC_PRIVATE | ZEND_ACC_CTOR)
+       PHP_ME(HashContext, __construct, NULL, ZEND_ACC_PRIVATE)
        PHP_FE_END
 };
 
index d7d6ed4ed97cdab0c322bde875bc80dd6487f469..0dcc134042f0472e46e7c3d6c2765c6b1e85e3e2 100644 (file)
@@ -97,7 +97,7 @@ ZEND_END_ARG_INFO()
  */
 
 static const zend_function_entry Collator_class_functions[] = {
-       PHP_ME( Collator, __construct, collator_1_arg, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR )
+       PHP_ME( Collator, __construct, collator_1_arg, ZEND_ACC_PUBLIC )
        ZEND_FENTRY( create, ZEND_FN( collator_create ), collator_1_arg, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
        PHP_NAMED_FE( compare, ZEND_FN( collator_compare ), collator_2_args )
        PHP_NAMED_FE( sort, ZEND_FN( collator_sort ), collator_sort_args )
index 95b0e6592c34591e1781199fadaa94852e12e613..eada568a80edfbe6fe7cfa6ac9b7e77b18c2a096 100644 (file)
@@ -969,7 +969,7 @@ static PHP_METHOD(UConverter, getStandards) {
 /* }}} */
 
 static const zend_function_entry php_converter_methods[] = {
-       PHP_ME(UConverter, __construct,            php_converter_arginfo,                   ZEND_ACC_PUBLIC | ZEND_ACC_CTOR)
+       PHP_ME(UConverter, __construct,            php_converter_arginfo,                   ZEND_ACC_PUBLIC)
 
        /* Encoding selection */
        PHP_ME(UConverter, setSourceEncoding,      php_converter_set_encoding_arginfo,      ZEND_ACC_PUBLIC)
index fc2be15e1ea266250086ac352fc98c6c8bf0b76c..b923f705088186ffc7a57a36e5d9105194774ef3 100644 (file)
@@ -158,7 +158,7 @@ ZEND_END_ARG_INFO()
  * Every 'IntlDateFormatter' class method has an entry in this table
  */
 static const zend_function_entry IntlDateFormatter_class_functions[] = {
-       PHP_ME( IntlDateFormatter, __construct, arginfo_intldateformatter___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR )
+       PHP_ME( IntlDateFormatter, __construct, arginfo_intldateformatter___construct, ZEND_ACC_PUBLIC )
        ZEND_FENTRY(  create, ZEND_FN( datefmt_create ), arginfo_intldateformatter___construct, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
        PHP_NAMED_FE( getDateType, ZEND_FN( datefmt_get_datetype ), arginfo_intldateformatter_getdatetype )
        PHP_NAMED_FE( getTimeType, ZEND_FN( datefmt_get_timetype ), arginfo_intldateformatter_getdatetype )
index d2356d57593db96ae5cd6879980338d6e5667b97..0b1066f29c54e07f5edbcfd40a8ce37cd9c1c01b 100644 (file)
@@ -151,7 +151,7 @@ ZEND_END_ARG_INFO()
  * Every 'NumberFormatter' class method has an entry in this table
  */
 static const zend_function_entry NumberFormatter_class_functions[] = {
-       PHP_ME( NumberFormatter, __construct, arginfo_numberformatter___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR )
+       PHP_ME( NumberFormatter, __construct, arginfo_numberformatter___construct, ZEND_ACC_PUBLIC )
        ZEND_FENTRY( create, ZEND_FN( numfmt_create ), arginfo_numberformatter___construct, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
        PHP_NAMED_FE( format, ZEND_FN( numfmt_format ), arginfo_numberformatter_format )
        PHP_NAMED_FE( parse, ZEND_FN( numfmt_parse ), number_parse_arginfo )
index 8501a2fe65a30aacc66997320afad891302c7179..cccc4f5c7555a4103d4394420e91f0559740b989 100644 (file)
@@ -125,7 +125,7 @@ ZEND_END_ARG_INFO()
  * Every 'MessageFormatter' class method has an entry in this table
  */
 static const zend_function_entry MessageFormatter_class_functions[] = {
-       PHP_ME( MessageFormatter, __construct, arginfo_messageformatter___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR )
+       PHP_ME( MessageFormatter, __construct, arginfo_messageformatter___construct, ZEND_ACC_PUBLIC )
        ZEND_FENTRY(  create, ZEND_FN( msgfmt_create ), arginfo_messageformatter___construct, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
        PHP_NAMED_FE( format, ZEND_FN( msgfmt_format ), arginfo_messageformatter_format )
        ZEND_FENTRY(  formatMessage, ZEND_FN( msgfmt_format_message ), arginfo_messageformatter_formatmessage, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
index 5b142a54d1d5186a283bf7f3b59018c2c4c59e8e..64f510e0fd21c5827e5e3edce4cecd5933e91110 100644 (file)
@@ -423,7 +423,7 @@ PHP_FUNCTION( resourcebundle_get_error_message )
  * Every 'ResourceBundle' class method has an entry in this table
  */
 static const zend_function_entry ResourceBundle_class_functions[] = {
-       PHP_ME( ResourceBundle, __construct, arginfo_resourcebundle___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR )
+       PHP_ME( ResourceBundle, __construct, arginfo_resourcebundle___construct, ZEND_ACC_PUBLIC )
        ZEND_NAMED_ME( create, ZEND_FN( resourcebundle_create ), arginfo_resourcebundle___construct, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC )
        ZEND_NAMED_ME( get, ZEND_FN(resourcebundle_get), arginfo_resourcebundle_get, ZEND_ACC_PUBLIC )
        ZEND_NAMED_ME( count, ZEND_FN(resourcebundle_count), arginfo_resourcebundle_count, ZEND_ACC_PUBLIC )
index f24eed3869ef17e2d5c9bc7a933761a25d1b193c..03d4caaad5bfa4996ca0b4871512495dc10adc21 100644 (file)
@@ -96,7 +96,7 @@ ZEND_END_ARG_INFO()
  */
 
 static const zend_function_entry Spoofchecker_class_functions[] = {
-       PHP_ME(Spoofchecker, __construct, spoofchecker_0_args, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
+       PHP_ME(Spoofchecker, __construct, spoofchecker_0_args, ZEND_ACC_PUBLIC)
        PHP_ME(Spoofchecker, isSuspicious, spoofchecker_is_suspicous, ZEND_ACC_PUBLIC)
        PHP_ME(Spoofchecker, areConfusable, spoofchecker_are_confusable, ZEND_ACC_PUBLIC)
        PHP_ME(Spoofchecker, setAllowedLocales, spoofchecker_set_allowed_locales, ZEND_ACC_PUBLIC)
index 3c58b433247bfcac89727f191889f588228c355a..e06ebd5c2595b55be9a01d9648e1657f7415b5cc 100644 (file)
@@ -311,7 +311,7 @@ ZEND_END_ARG_INFO()
  * Every 'Transliterator' class method has an entry in this table
  */
 static const zend_function_entry Transliterator_class_functions[] = {
-       PHP_ME( Transliterator,                 __construct,                                            ainfo_trans_void,                               ZEND_ACC_PRIVATE | ZEND_ACC_CTOR | ZEND_ACC_FINAL )
+       PHP_ME( Transliterator,                 __construct,                                            ainfo_trans_void,                               ZEND_ACC_PRIVATE | ZEND_ACC_FINAL )
        PHP_ME_MAPPING( create,                 transliterator_create,                          ainfo_trans_create,                             ZEND_ACC_STATIC |ZEND_ACC_PUBLIC )
        PHP_ME_MAPPING( createFromRules,transliterator_create_from_rules,       ainfo_trans_create_from_rules,  ZEND_ACC_STATIC | ZEND_ACC_PUBLIC )
        PHP_ME_MAPPING( createInverse,  transliterator_create_inverse,          ainfo_trans_void,                               ZEND_ACC_PUBLIC )
index e20479837bc81d91efee77a8f2c3e09e6b1da9ec..8fe8da071ae3c28489c05a0d943da1d2c2732938 100644 (file)
@@ -472,7 +472,7 @@ static void _class_string(smart_str *str, zend_class_entry *ce, zval *obj, char
                                size_t len = ZSTR_LEN(mptr->common.function_name);
 
                                /* Do not display old-style inherited constructors */
-                               if ((mptr->common.fn_flags & ZEND_ACC_CTOR) == 0
+                               if (mptr->common.scope->constructor != mptr
                                        || mptr->common.scope == ce
                                        || !key
                                        || zend_binary_strcasecmp(ZSTR_VAL(key), ZSTR_LEN(key), ZSTR_VAL(mptr->common.function_name), len) == 0)
@@ -744,10 +744,10 @@ static void _function_string(smart_str *str, zend_function *fptr, zend_class_ent
        if (fptr->common.prototype && fptr->common.prototype->common.scope) {
                smart_str_append_printf(str, ", prototype %s", ZSTR_VAL(fptr->common.prototype->common.scope->name));
        }
-       if (fptr->common.fn_flags & ZEND_ACC_CTOR) {
+       if (fptr->common.scope && fptr->common.scope->constructor == fptr) {
                smart_str_appends(str, ", ctor");
        }
-       if (fptr->common.fn_flags & ZEND_ACC_DTOR) {
+       if (fptr->common.scope && fptr->common.scope->destructor == fptr) {
                smart_str_appends(str, ", dtor");
        }
        smart_str_appends(str, "> ");
@@ -3407,7 +3407,7 @@ ZEND_METHOD(reflection_method, isConstructor)
        /* we need to check if the ctor is the ctor of the class level we we
         * looking at since we might be looking at an inherited old style ctor
         * defined in base class. */
-       RETURN_BOOL(mptr->common.fn_flags & ZEND_ACC_CTOR && intern->ce->constructor && intern->ce->constructor->common.scope == mptr->common.scope);
+       RETURN_BOOL(intern->ce->constructor == mptr);
 }
 /* }}} */
 
@@ -3422,7 +3422,7 @@ ZEND_METHOD(reflection_method, isDestructor)
                return;
        }
        GET_REFLECTION_OBJECT_PTR(mptr);
-       RETURN_BOOL(mptr->common.fn_flags & ZEND_ACC_DTOR);
+       RETURN_BOOL(intern->ce->destructor == mptr);
 }
 /* }}} */
 
index 2c269fc337cc685d2c0191f1551b99f18b5fdbba..c91aec17cd96f87304d308dbcf0bf90b225cf30d 100644 (file)
@@ -2014,7 +2014,7 @@ static const zend_function_entry php_sqlite3_class_methods[] = {
        PHP_ME(sqlite3,         openBlob,                       arginfo_sqlite3_openblob, ZEND_ACC_PUBLIC)
        PHP_ME(sqlite3,         enableExceptions,       arginfo_sqlite3_enableexceptions, ZEND_ACC_PUBLIC)
        /* Aliases */
-       PHP_MALIAS(sqlite3,     __construct, open, arginfo_sqlite3_open, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
+       PHP_MALIAS(sqlite3,     __construct, open, arginfo_sqlite3_open, ZEND_ACC_PUBLIC)
        PHP_FE_END
 };
 /* }}} */
@@ -2029,7 +2029,7 @@ static const zend_function_entry php_sqlite3_stmt_class_methods[] = {
        PHP_ME(sqlite3stmt, bindParam,  arginfo_sqlite3stmt_bindparam, ZEND_ACC_PUBLIC)
        PHP_ME(sqlite3stmt, bindValue,  arginfo_sqlite3stmt_bindvalue, ZEND_ACC_PUBLIC)
        PHP_ME(sqlite3stmt, readOnly,   arginfo_sqlite3_void, ZEND_ACC_PUBLIC)
-       PHP_ME(sqlite3stmt, __construct, arginfo_sqlite3stmt_construct, ZEND_ACC_PRIVATE|ZEND_ACC_CTOR)
+       PHP_ME(sqlite3stmt, __construct, arginfo_sqlite3stmt_construct, ZEND_ACC_PRIVATE)
        PHP_FE_END
 };
 /* }}} */
@@ -2042,7 +2042,7 @@ static const zend_function_entry php_sqlite3_result_class_methods[] = {
        PHP_ME(sqlite3result, fetchArray,               arginfo_sqlite3result_fetcharray, ZEND_ACC_PUBLIC)
        PHP_ME(sqlite3result, reset,                    arginfo_sqlite3_void, ZEND_ACC_PUBLIC)
        PHP_ME(sqlite3result, finalize,                 arginfo_sqlite3_void, ZEND_ACC_PUBLIC)
-       PHP_ME(sqlite3result, __construct,              arginfo_sqlite3_void, ZEND_ACC_PRIVATE|ZEND_ACC_CTOR)
+       PHP_ME(sqlite3result, __construct,              arginfo_sqlite3_void, ZEND_ACC_PRIVATE)
        PHP_FE_END
 };
 /* }}} */