1
0
mirror of https://github.com/php/php-src.git synced 2026-04-26 17:38:14 +02:00

Fixes for abstract classes/methods

This commit is contained in:
Marcus Boerger
2004-02-27 09:14:55 +00:00
parent 7c6b73ce38
commit f449c8fdf7
3 changed files with 11 additions and 5 deletions
+6 -3
View File
@@ -1245,12 +1245,15 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr
} else {
internal_function->fn_flags = ZEND_ACC_PUBLIC;
}
if (ptr->flags&ZEND_ACC_ABSTRACT) {
if (ptr->flags & ZEND_ACC_ABSTRACT) {
if (scope) {
scope->ce_flags |= ZEND_ACC_ABSTRACT_CLASS;
scope->ce_flags |= ZEND_ACC_ABSTRACT;
if (!(scope->ce_flags & ZEND_ACC_INTERFACE)) {
scope->ce_flags |= ZEND_ACC_ABSTRACT_CLASS;
}
}
} else {
if (scope && scope->ce_flags&ZEND_ACC_INTERFACE) {
if (scope && (scope->ce_flags & ZEND_ACC_INTERFACE)) {
zend_error(error_type, "Interface %s cannot contain non abstract method %s()", scope->name, ptr->fname);
return FAILURE;
}
+4 -1
View File
@@ -2563,7 +2563,10 @@ void zend_do_end_class_declaration(znode *class_token, znode *parent_token TSRML
if (!(ce->ce_flags & ZEND_ACC_INTERFACE)
&& !(ce->ce_flags & ZEND_ACC_ABSTRACT_CLASS)
&& ((parent_token->op_type != IS_UNUSED) || (ce->num_interfaces > 0))) {
do_verify_abstract_class(TSRMLS_C);
zend_verify_abstract_class(ce TSRMLS_CC);
if (ce->parent || ce->num_interfaces) {
do_verify_abstract_class(TSRMLS_C);
}
}
CG(active_class_entry) = NULL;
}
+1 -1
View File
@@ -3167,7 +3167,7 @@ int zend_switch_free_handler(ZEND_OPCODE_HANDLER_ARGS)
int zend_new_handler(ZEND_OPCODE_HANDLER_ARGS)
{
if (EX_T(opline->op1.u.var).class_entry->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_ABSTRACT_CLASS)) {
if (EX_T(opline->op1.u.var).class_entry->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_ABSTRACT|ZEND_ACC_ABSTRACT_CLASS)) {
char *class_type;
if (EX_T(opline->op1.u.var).class_entry->ce_flags & ZEND_ACC_INTERFACE) {