mirror of
https://github.com/php/php-src.git
synced 2026-04-27 01:48:26 +02:00
Enforce semantics: Classes cannot extend Interfaces
This commit is contained in:
@@ -2125,6 +2125,10 @@ ZEND_API zend_class_entry *do_bind_inherited_class(zend_op *opline, HashTable *c
|
||||
ce = *pce;
|
||||
}
|
||||
|
||||
if (parent_ce->ce_flags & ZEND_ACC_INTERFACE) {
|
||||
zend_error(E_COMPILE_ERROR, "Class %s cannot extend from interfac %s", ce->name, parent_ce->name);
|
||||
}
|
||||
|
||||
zend_do_inheritance(ce, parent_ce TSRMLS_CC);
|
||||
|
||||
ce->refcount++;
|
||||
|
||||
Reference in New Issue
Block a user