1
0
mirror of https://github.com/php/php-src.git synced 2026-04-11 18:13:00 +02:00

Merge branch 'PHP-7.4'

* PHP-7.4:
  Use unmangled named in property type inheritance error
This commit is contained in:
Nikita Popov
2019-12-09 08:49:42 +01:00
2 changed files with 12 additions and 1 deletions

View File

@@ -0,0 +1,11 @@
--TEST--
Typed property invariance violation for protected properties
--FILE--
<?php
class A { protected int $x; }
class B extends A { protected $x; }
?>
--EXPECTF--
Fatal error: Type of B::$x must be int (as in class A) in %s on line %d

View File

@@ -976,7 +976,7 @@ static void emit_incompatible_property_error(
zend_error_noreturn(E_COMPILE_ERROR,
"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),
ZSTR_VAL(type_str),
ZSTR_VAL(parent->ce->name));
}