Skip to content

Commit 77ebf81

Browse files
committed
Merge branch 'PHP-8.0'
* PHP-8.0: Fix refcount inference for typed properties
2 parents 53e9c36 + 82622d7 commit 77ebf81

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Zend/Optimizer/zend_inference.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2316,10 +2316,6 @@ static uint32_t zend_fetch_prop_type(const zend_script *script, zend_property_in
23162316
}
23172317
if (prop_info && ZEND_TYPE_IS_SET(prop_info->type)) {
23182318
uint32_t type = zend_convert_type_declaration_mask(ZEND_TYPE_PURE_MASK(prop_info->type));
2319-
2320-
if (type & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE)) {
2321-
type |= MAY_BE_RC1 | MAY_BE_RCN;
2322-
}
23232319
if (ZEND_TYPE_HAS_CLASS(prop_info->type)) {
23242320
type |= MAY_BE_OBJECT;
23252321
if (pce) {
@@ -2332,6 +2328,9 @@ static uint32_t zend_fetch_prop_type(const zend_script *script, zend_property_in
23322328
}
23332329
}
23342330
}
2331+
if (type & (MAY_BE_STRING|MAY_BE_ARRAY|MAY_BE_OBJECT|MAY_BE_RESOURCE)) {
2332+
type |= MAY_BE_RC1 | MAY_BE_RCN;
2333+
}
23352334
return type;
23362335
}
23372336
return MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF | MAY_BE_RC1 | MAY_BE_RCN;

0 commit comments

Comments
 (0)