From: Marcus Boerger Date: Sat, 5 Jun 2004 14:59:21 +0000 (+0000) Subject: Fix #28641: Instance of Interface X-Git-Tag: php-5.0.0RC3~20 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a6276a241465c6c1d337a5488480249088692fad;p=php Fix #28641: Instance of Interface --- diff --git a/Zend/zend_API.c b/Zend/zend_API.c index ac78284378..793727900c 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -694,6 +694,11 @@ ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *class_type zval *tmp; zend_object *object; + if (class_type->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS)) { + char *what = class_type->ce_flags & ZEND_ACC_INTERFACE ? "interface" : "abstract class"; + zend_error(E_ERROR, "Cannot instantiate %s %s", what, class_type->name); + } + if (!class_type->constants_updated) { zend_hash_apply_with_argument(&class_type->default_properties, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC); zend_hash_apply_with_argument(class_type->static_members, (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC);