summaryrefslogtreecommitdiff
path: root/Zend/zend_API.c
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2003-08-17 00:57:35 +0000
committerMarcus Boerger <helly@php.net>2003-08-17 00:57:35 +0000
commit82050ae8bcb9a74037cb66d57449a293eeb16eb4 (patch)
tree19f162399c257826bdc5585b911c89848ea82f00 /Zend/zend_API.c
parenteca25827602043ef190d594525b83fade4eccade (diff)
downloadphp-git-82050ae8bcb9a74037cb66d57449a293eeb16eb4.tar.gz
- Show class names in error messages when dealing with methods
- Mark class as abstract if it gets an abstract method
Diffstat (limited to 'Zend/zend_API.c')
-rw-r--r--Zend/zend_API.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index 9255ade0ac..cd2d0f85b3 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -1179,16 +1179,22 @@ int zend_register_functions(zend_class_entry *scope, zend_function_entry *functi
}
if (ptr->flags) {
if (!(ptr->flags & ZEND_ACC_PPP_MASK)) {
- zend_error(error_type, "Invalid access level for %s() - access must be exactly one of public, protected or private", ptr->fname);
+ zend_error(error_type, "Invalid access level for %s%s%s() - access must be exactly one of public, protected or private", scope ? scope->name : "", scope ? "::" : "", ptr->fname);
}
internal_function->fn_flags = ptr->flags;
} else {
internal_function->fn_flags = ZEND_ACC_PUBLIC;
}
- if (!internal_function->handler && !(ptr->flags&ZEND_ACC_ABSTRACT)) {
- zend_error(error_type, "Null function defined as active function");
- zend_unregister_functions(functions, count, target_function_table TSRMLS_CC);
- return FAILURE;
+ if (ptr->flags&ZEND_ACC_ABSTRACT) {
+ if (scope) {
+ scope->ce_flags |= ZEND_ACC_ABSTRACT;
+ }
+ } else {
+ if (!internal_function->handler) {
+ zend_error(error_type, "Method %s%s%s() cannot be a NULL function", scope ? scope->name : "", scope ? "::" : "", ptr->fname);
+ zend_unregister_functions(functions, count, target_function_table TSRMLS_CC);
+ return FAILURE;
+ }
}
fname_len = strlen(ptr->fname);
lowercase_name = do_alloca(fname_len+1);