]> granicus.if.org Git - php/commitdiff
Removed ZEND_ACC_FINAL_CLASS which is unnecessary. This also fixed some currently...
authorGuilherme Blanco <guilhermeblanco@hotmail.com>
Sat, 22 Nov 2014 04:57:55 +0000 (04:57 +0000)
committerJulien Pauli <jpauli@php.net>
Fri, 12 Dec 2014 16:29:54 +0000 (17:29 +0100)
13 files changed:
Zend/zend_closures.c
Zend/zend_compile.h
Zend/zend_generators.c
Zend/zend_inheritance.c
Zend/zend_language_parser.y
ext/mysqli/mysqli.c
ext/pdo/pdo_stmt.c
ext/phar/phar_object.c
ext/reflection/php_reflection.c
ext/reflection/tests/ReflectionClass_getModifiers_basic.phpt
ext/reflection/tests/ReflectionClass_modifiers_001.phpt
ext/reflection/tests/ReflectionClass_toString_001.phpt
ext/tidy/tidy.c

index bf0ba0ace405018b5e720d4859726013f4ee25ef..b9d097c424d86c52779fc6e7441ddf04e8a921ba 100644 (file)
@@ -445,7 +445,7 @@ void zend_register_closure_ce(TSRMLS_D) /* {{{ */
 
        INIT_CLASS_ENTRY(ce, "Closure", closure_functions);
        zend_ce_closure = zend_register_internal_class(&ce TSRMLS_CC);
-       zend_ce_closure->ce_flags |= ZEND_ACC_FINAL_CLASS;
+       zend_ce_closure->ce_flags |= ZEND_ACC_FINAL;
        zend_ce_closure->create_object = zend_closure_new;
        zend_ce_closure->serialize = zend_class_serialize_deny;
        zend_ce_closure->unserialize = zend_class_unserialize_deny;
index c44b37b995831c43dc60010c38188030953398b8..3b1e046cc0a03e5e160389b136a1d46c0034af10 100644 (file)
@@ -182,7 +182,6 @@ typedef struct _zend_try_catch_element {
 /* ZEND_ACC_EXPLICIT_ABSTRACT_CLASS denotes that a class was explicitly defined as abstract by using the keyword. */
 #define ZEND_ACC_IMPLICIT_ABSTRACT_CLASS       0x10
 #define ZEND_ACC_EXPLICIT_ABSTRACT_CLASS       0x20
-#define ZEND_ACC_FINAL_CLASS               0x40
 #define ZEND_ACC_INTERFACE                         0x80
 #define ZEND_ACC_TRAIT                                         0x120
 
index 2d1810ef78d08ca5c25ace66cd6254c6a28d1ec9..c3827c5c51144bad6b520d194dbee842081c56bd 100644 (file)
@@ -671,7 +671,7 @@ void zend_register_generator_ce(TSRMLS_D) /* {{{ */
 
        INIT_CLASS_ENTRY(ce, "Generator", generator_functions);
        zend_ce_generator = zend_register_internal_class(&ce TSRMLS_CC);
-       zend_ce_generator->ce_flags |= ZEND_ACC_FINAL_CLASS;
+       zend_ce_generator->ce_flags |= ZEND_ACC_FINAL;
        zend_ce_generator->create_object = zend_generator_create;
        zend_ce_generator->serialize = zend_class_serialize_deny;
        zend_ce_generator->unserialize = zend_class_unserialize_deny;
index cf2a3cb4add383df4f76d60c12dcc4570c3d207e..9b81978e6e2557f3cee2049b62be0abdc5c8076b 100644 (file)
@@ -727,7 +727,7 @@ ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent
                && !(parent_ce->ce_flags & ZEND_ACC_INTERFACE)) {
                zend_error_noreturn(E_COMPILE_ERROR, "Interface %s may not inherit from class (%s)", ce->name->val, parent_ce->name->val);
        }
-       if (parent_ce->ce_flags & ZEND_ACC_FINAL_CLASS) {
+       if (parent_ce->ce_flags & ZEND_ACC_FINAL) {
                zend_error_noreturn(E_COMPILE_ERROR, "Class %s may not inherit from final class (%s)", ce->name->val, parent_ce->name->val);
        }
 
index 94734defe2203ffcf573cfba7c5a5a53fa5ea407..4d6664805527bb3467deeef6cd65a09b7efcfc3b 100644 (file)
@@ -435,7 +435,7 @@ class_declaration_statement:
 class_type:
                T_CLASS                         { $$ = 0; }
        |       T_ABSTRACT T_CLASS      { $$ = ZEND_ACC_EXPLICIT_ABSTRACT_CLASS; }
-       |       T_FINAL T_CLASS         { $$ = ZEND_ACC_FINAL_CLASS; }
+       |       T_FINAL T_CLASS         { $$ = ZEND_ACC_FINAL; }
        |       T_TRAIT                         { $$ = ZEND_ACC_TRAIT; }
 ;
 
index 878c8fb94677f2be0103592efe21e48dbf03c1df..6d7210fe592c24844cafd39c336b07d0e1a72df7 100644 (file)
@@ -625,7 +625,7 @@ PHP_MINIT_FUNCTION(mysqli)
        zend_declare_property_null(ce, "embedded",                      sizeof("embedded") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
        zend_declare_property_null(ce, "reconnect",                     sizeof("reconnect") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
        zend_declare_property_null(ce, "report_mode",           sizeof("report_mode") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
-       ce->ce_flags |= ZEND_ACC_FINAL_CLASS;
+       ce->ce_flags |= ZEND_ACC_FINAL;
        zend_hash_add_ptr(&classes, ce->name, &mysqli_driver_properties);
 
        REGISTER_MYSQLI_CLASS_ENTRY("mysqli", mysqli_link_class_entry, mysqli_link_methods);
@@ -655,7 +655,7 @@ PHP_MINIT_FUNCTION(mysqli)
 
        REGISTER_MYSQLI_CLASS_ENTRY("mysqli_warning", mysqli_warning_class_entry, mysqli_warning_methods);
        ce = mysqli_warning_class_entry;
-       ce->ce_flags |= ZEND_ACC_FINAL_CLASS | ZEND_ACC_PROTECTED;
+       ce->ce_flags |= ZEND_ACC_FINAL;
        zend_hash_init(&mysqli_warning_properties, 0, NULL, free_prop_handler, 1);
        MYSQLI_ADD_PROPERTIES(&mysqli_warning_properties, mysqli_warning_property_entries);
        zend_declare_property_null(ce, "message",       sizeof("message") - 1, ZEND_ACC_PUBLIC TSRMLS_CC);
index 27cc157ed72408e74af12eabad458f400cedf9ad..1491c80cfdddca99cf36d6c567a844a39ebda9f2 100644 (file)
@@ -2292,7 +2292,7 @@ void pdo_stmt_init(TSRMLS_D)
 
        INIT_CLASS_ENTRY(ce, "PDORow", pdo_row_functions);
        pdo_row_ce = zend_register_internal_class(&ce TSRMLS_CC);
-       pdo_row_ce->ce_flags |= ZEND_ACC_FINAL_CLASS; /* when removing this a lot of handlers need to be redone */
+       pdo_row_ce->ce_flags |= ZEND_ACC_FINAL; /* when removing this a lot of handlers need to be redone */
        pdo_row_ce->create_object = pdo_row_new;
        pdo_row_ce->serialize = pdo_row_serialize;
 }
index f82b82563144fb199c47c6a44fd82580e7759d58..d23c7cd6c6f09f42b1671ba04a49784b32efb3d7 100755 (executable)
@@ -5308,11 +5308,11 @@ void phar_object_init(TSRMLS_D) /* {{{ */
 #else
        INIT_CLASS_ENTRY(ce, "Phar", php_archive_methods);
        phar_ce_archive = zend_register_internal_class(&ce TSRMLS_CC);
-       phar_ce_archive->ce_flags |= ZEND_ACC_FINAL_CLASS;
+       phar_ce_archive->ce_flags |= ZEND_ACC_FINAL;
 
        INIT_CLASS_ENTRY(ce, "PharData", php_archive_methods);
        phar_ce_data = zend_register_internal_class(&ce TSRMLS_CC);
-       phar_ce_data->ce_flags |= ZEND_ACC_FINAL_CLASS;
+       phar_ce_data->ce_flags |= ZEND_ACC_FINAL;
 #endif
 
        REGISTER_PHAR_CLASS_CONST_LONG(phar_ce_archive, "BZ2", PHAR_ENT_COMPRESSED_BZ2)
index 18906d6004e1fecc134d6f84e23aece197cddd61..026680cd6d55d85958019949adf9db7211092efb 100644 (file)
@@ -395,7 +395,7 @@ static void _class_string(string *str, zend_class_entry *ce, zval *obj, char *in
                if (ce->ce_flags & (ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS)) {
                        string_printf(str, "abstract ");
                }
-               if (ce->ce_flags & ZEND_ACC_FINAL_CLASS) {
+               if (ce->ce_flags & ZEND_ACC_FINAL) {
                        string_printf(str, "final ");
                }
                string_printf(str, "class ");
@@ -1557,7 +1557,7 @@ ZEND_METHOD(reflection, getModifierNames)
        if (modifiers & (ZEND_ACC_ABSTRACT | ZEND_ACC_EXPLICIT_ABSTRACT_CLASS)) {
                add_next_index_stringl(return_value, "abstract", sizeof("abstract")-1);
        }
-       if (modifiers & (ZEND_ACC_FINAL | ZEND_ACC_FINAL_CLASS)) {
+       if (modifiers & ZEND_ACC_FINAL) {
                add_next_index_stringl(return_value, "final", sizeof("final")-1);
        }
        if (modifiers & ZEND_ACC_IMPLICIT_PUBLIC) {
@@ -4162,7 +4162,7 @@ ZEND_METHOD(reflection_class, isTrait)
    Returns whether this class is final */
 ZEND_METHOD(reflection_class, isFinal)
 {
-       _class_check_flag(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_FINAL_CLASS);
+       _class_check_flag(INTERNAL_FUNCTION_PARAM_PASSTHRU, ZEND_ACC_FINAL);
 }
 /* }}} */
 
@@ -4290,7 +4290,7 @@ ZEND_METHOD(reflection_class, newInstanceWithoutConstructor)
        METHOD_NOTSTATIC(reflection_class_ptr);
        GET_REFLECTION_OBJECT_PTR(ce);
 
-       if (ce->create_object != NULL && ce->ce_flags & ZEND_ACC_FINAL_CLASS) {
+       if (ce->create_object != NULL && ce->ce_flags & ZEND_ACC_FINAL) {
                zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Class %s is an internal class marked as final that cannot be instantiated without invoking its constructor", ce->name->val);
        }
 
@@ -6187,7 +6187,7 @@ PHP_MINIT_FUNCTION(reflection) /* {{{ */
 
        REGISTER_REFLECTION_CLASS_CONST_LONG(class, "IS_IMPLICIT_ABSTRACT", ZEND_ACC_IMPLICIT_ABSTRACT_CLASS);
        REGISTER_REFLECTION_CLASS_CONST_LONG(class, "IS_EXPLICIT_ABSTRACT", ZEND_ACC_EXPLICIT_ABSTRACT_CLASS);
-       REGISTER_REFLECTION_CLASS_CONST_LONG(class, "IS_FINAL", ZEND_ACC_FINAL_CLASS);
+       REGISTER_REFLECTION_CLASS_CONST_LONG(class, "IS_FINAL", ZEND_ACC_FINAL);
 
        INIT_CLASS_ENTRY(_reflection_entry, "ReflectionObject", reflection_object_functions);
        _reflection_entry.create_object = reflection_objects_new;
index 65f23c935f91e6b9e875c45241e157db80bddaf5..8d2bd47d12da131646f8516727899c97df107b95 100644 (file)
@@ -30,7 +30,7 @@ dump_modifiers('g');
 --EXPECT--
 int(0)
 int(32)
-int(64)
+int(4)
 int(128)
 int(524288)
 int(524416)
index 941bfe5f2b9f9f72ad9dae76adb9a4a6e643737b..1e0a97dfe088d05584f84b03e7332c9aa4cdcabc 100644 (file)
@@ -37,7 +37,7 @@ int(0)
 bool(true)
 bool(false)
 bool(false)
-int(64)
+int(4)
 bool(false)
 bool(true)
 bool(false)
index 8dd571c3a9cc2386288504d19bcf9668e5e49392..c47aba8b8d622b2f3c6a96daad0a7bff4177ffa8 100644 (file)
@@ -14,7 +14,7 @@ Class [ <internal:Reflection> class ReflectionClass implements Reflector ] {
   - Constants [3] {
     Constant [ integer IS_IMPLICIT_ABSTRACT ] { 16 }
     Constant [ integer IS_EXPLICIT_ABSTRACT ] { 32 }
-    Constant [ integer IS_FINAL ] { 64 }
+    Constant [ integer IS_FINAL ] { 4 }
   }
 
   - Static properties [0] {
index 8ca27d7b9a454989b6d7b9ad97479f5c68b79a14..23531e9ae3e9c0f6f1c8411c3d703a4a5b8981dd 100644 (file)
@@ -1037,7 +1037,7 @@ static PHP_MINIT_FUNCTION(tidy)
 
        REGISTER_INI_ENTRIES();
        REGISTER_TIDY_CLASS(tidy, doc,  NULL, 0);
-       REGISTER_TIDY_CLASS(tidyNode, node,     NULL, ZEND_ACC_FINAL_CLASS);
+       REGISTER_TIDY_CLASS(tidyNode, node,     NULL, ZEND_ACC_FINAL);
 
        tidy_object_handlers_doc.cast_object = tidy_doc_cast_handler;
        tidy_object_handlers_node.cast_object = tidy_node_cast_handler;