Add support for the mixed type

RFC: https://wiki.php.net/rfc/mixed_type_v2
Closes GH-5313

Co-authored-by: Dan Ackroyd <danack@basereality.com>
This commit is contained in:
Máté Kocsis 2020-03-27 23:39:49 +01:00
parent 4bc1d8333a
commit aec4c0fd03
No known key found for this signature in database
GPG key ID: FD055E41728BF310
55 changed files with 927 additions and 15 deletions

View file

@ -507,8 +507,8 @@ static inheritance_status zend_do_perform_arg_type_hint_check(
zend_class_entry *fe_scope, zend_arg_info *fe_arg_info,
zend_class_entry *proto_scope, zend_arg_info *proto_arg_info) /* {{{ */
{
if (!ZEND_TYPE_IS_SET(fe_arg_info->type)) {
/* Child with no type is always compatible */
if (!ZEND_TYPE_IS_SET(fe_arg_info->type) || ZEND_TYPE_PURE_MASK(fe_arg_info->type) == MAY_BE_ANY) {
/* Child with no type or mixed type is always compatible */
return INHERITANCE_SUCCESS;
}