&& !(parent_ce->ce_flags & ZEND_ACC_INTERFACE)) {
zend_error(E_ERROR, "Interface %s may not inherit from class (%s)", ce->name, parent_ce->name);
}
+ if (parent_ce->ce_flags & ZEND_ACC_FINAL_CLASS) {
+ zend_error(E_ERROR, "Class %s may not inherit from final class (%s)", ce->name, parent_ce->name);
+ }
ce->parent = parent_ce;
/* Inherit interfaces */
#define ZEND_ACC_FINAL 0x04
#define ZEND_ACC_INTERFACE 0x08
#define ZEND_ACC_ABSTRACT_CLASS 0x10
+#define ZEND_ACC_FINAL_CLASS 0x20
/* The order of those must be kept - public < protected < private */
#define ZEND_ACC_PUBLIC 0x100
class_entry_type:
T_CLASS { $$.u.constant.value.lval = 0; }
| T_ABSTRACT T_CLASS { $$.u.constant.value.lval = ZEND_ACC_ABSTRACT_CLASS; }
+ | T_FINAL T_CLASS { $$.u.constant.value.lval = ZEND_ACC_FINAL_CLASS; }
| T_INTERFACE { $$.u.constant.value.lval = ZEND_ACC_INTERFACE; }
;