diff --git a/Zend/tests/type_declarations/mixed/inheritance/mixed_property_inheritance_error7.phpt b/Zend/tests/type_declarations/mixed/inheritance/mixed_property_inheritance_error7.phpt index 138952b3df56b..0a63cc23df9fd 100644 --- a/Zend/tests/type_declarations/mixed/inheritance/mixed_property_inheritance_error7.phpt +++ b/Zend/tests/type_declarations/mixed/inheritance/mixed_property_inheritance_error7.phpt @@ -15,4 +15,4 @@ class Bar extends Foo ?> --EXPECTF-- -Fatal error: Type of Bar::$property1 must not be defined (as in class Foo) in %s on line %d +Fatal error: Type of Bar::$property1 must be omitted to match the parent definition in class Foo in %s on line %d diff --git a/Zend/tests/type_declarations/typed_properties_035.phpt b/Zend/tests/type_declarations/typed_properties_035.phpt index 165479021a77b..ee7085d8837cc 100644 --- a/Zend/tests/type_declarations/typed_properties_035.phpt +++ b/Zend/tests/type_declarations/typed_properties_035.phpt @@ -11,4 +11,4 @@ class Baz extends Foo{ } ?> --EXPECTF-- -Fatal error: Type of Baz::$bar must not be defined (as in class Foo) in %s on line 6 +Fatal error: Type of Baz::$bar must be omitted to match the parent definition in class Foo in %s on line 6 diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c index 3e09206b31566..d85bfeb6ae2ab 100644 --- a/Zend/zend_inheritance.c +++ b/Zend/zend_inheritance.c @@ -1507,7 +1507,7 @@ static void do_inherit_property(zend_property_info *parent_info, zend_string *ke } } else if (UNEXPECTED(ZEND_TYPE_IS_SET(child_info->type) && !ZEND_TYPE_IS_SET(parent_info->type))) { zend_error_noreturn(E_COMPILE_ERROR, - "Type of %s::$%s must not be defined (as in class %s)", + "Type of %s::$%s must be omitted to match the parent definition in class %s", ZSTR_VAL(ce->name), ZSTR_VAL(key), ZSTR_VAL(parent_info->ce->name));