]> granicus.if.org Git - php/commitdiff
MFH: Enforce semantics: Classes cannot extend Interfaces
authorMarcus Boerger <helly@php.net>
Thu, 26 Aug 2004 23:02:55 +0000 (23:02 +0000)
committerMarcus Boerger <helly@php.net>
Thu, 26 Aug 2004 23:02:55 +0000 (23:02 +0000)
Zend/zend_compile.c

index b50a77717eff67758168dc2dd4a5fd656360c01f..815033ea5845064f64f846d233e9ef2c35181012 100644 (file)
@@ -2123,6 +2123,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++;