]> granicus.if.org Git - php/commitdiff
Fix copy-and-paste bugs
authorLevi Morrison <levim@php.net>
Wed, 13 Dec 2017 05:39:28 +0000 (22:39 -0700)
committerNikita Popov <nikita.ppv@gmail.com>
Wed, 13 Dec 2017 20:25:00 +0000 (21:25 +0100)
Zend/zend_API.c
Zend/zend_closures.c

index e70fefa3b54b232c6f6dc6ce8896ed397044a163..1070dcecbd80562603ef796c771880c6004c46f2 100644 (file)
@@ -2351,7 +2351,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
                if (clone) {
                        clone->common.fn_flags |= ZEND_ACC_CLONE;
                        if (clone->common.fn_flags & ZEND_ACC_STATIC) {
-                               zend_error(error_type, "Constructor %s::%s() cannot be static", ZSTR_VAL(scope->name), ZSTR_VAL(clone->common.function_name));
+                               zend_error(error_type, "%s::%s() cannot be static", ZSTR_VAL(scope->name), ZSTR_VAL(clone->common.function_name));
                        }
                        clone->common.fn_flags &= ~ZEND_ACC_ALLOW_STATIC;
                }
@@ -2411,7 +2411,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, const zend_functio
                        zend_error_noreturn(E_CORE_ERROR, "Destructor %s::%s() cannot declare a return type", ZSTR_VAL(scope->name), ZSTR_VAL(dtor->common.function_name));
                }
 
-               if (clone && clone->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE && dtor->common.fn_flags & ZEND_ACC_DTOR) {
+               if (clone && (clone->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE)) {
                        zend_error_noreturn(E_CORE_ERROR, "%s::%s() cannot declare a return type", ZSTR_VAL(scope->name), ZSTR_VAL(clone->common.function_name));
                }
                efree((char*)lc_class_name);
index b047aaf3a9c8e62beb459c71a471098569090158..95902f71e1fac73929e0e361fde5dd0d8a5acb78 100644 (file)
@@ -244,7 +244,7 @@ static void zend_closure_call_magic(INTERNAL_FUNCTION_PARAMETERS) /* {{{ */ {
        zval params[2];
 
        memset(&fci, 0, sizeof(zend_fcall_info));
-       memset(&fci, 0, sizeof(zend_fcall_info_cache));
+       memset(&fcc, 0, sizeof(zend_fcall_info_cache));
 
        fci.size = sizeof(zend_fcall_info);
        fci.retval = return_value;