]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.4'
authorNikita Popov <nikita.ppv@gmail.com>
Mon, 9 Dec 2019 07:49:42 +0000 (08:49 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 9 Dec 2019 07:49:42 +0000 (08:49 +0100)
* PHP-7.4:
  Use unmangled named in property type inheritance error

1  2 
Zend/zend_inheritance.c

index 1a27bbdfb6cedf49ef98ab64784f58bede4a94d8,0dbb5b77a61de3716f22668a5132b543714d5a0f..220df561a2b76061e85eeb7f9dff0d3b6dd12692
@@@ -972,12 -933,14 +972,12 @@@ inheritance_status property_types_compa
  
  static void emit_incompatible_property_error(
                const zend_property_info *child, const zend_property_info *parent) {
 +      zend_string *type_str = zend_type_to_string_resolved(parent->type, parent->ce);
        zend_error_noreturn(E_COMPILE_ERROR,
 -              "Type of %s::$%s must be %s%s (as in class %s)",
 +              "Type of %s::$%s must be %s (as in class %s)",
                ZSTR_VAL(child->ce->name),
-               ZSTR_VAL(child->name),
+               zend_get_unmangled_property_name(child->name),
 -              ZEND_TYPE_ALLOW_NULL(parent->type) ? "?" : "",
 -              ZEND_TYPE_IS_CLASS(parent->type)
 -                      ? ZSTR_VAL(ZEND_TYPE_IS_CE(parent->type) ? ZEND_TYPE_CE(parent->type)->name : resolve_class_name(parent->ce, ZEND_TYPE_NAME(parent->type)))
 -                      : zend_get_type_by_const(ZEND_TYPE_CODE(parent->type)),
 +              ZSTR_VAL(type_str),
                ZSTR_VAL(parent->ce->name));
  }