Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 be omitted to match the parent definition in class Foo in %s on line %d
2 changes: 1 addition & 1 deletion Zend/tests/type_declarations/typed_properties_035.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion Zend/zend_inheritance.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
Loading