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

index 2c1faddc573b2efcbce8763f61a01f9086ce5145..862ba578f2b14465634f8534342229c35b251a10 100644 (file)
@@ -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++;