Skip to content

Commit 1c4eb07

Browse files
committed
Simplify expression
It was also actually incorrect. When the child "removes" hooks (it can't really, they'll be inherited later on), it should not result in a new property slot.
1 parent ea00ff3 commit 1c4eb07

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Zend/zend_inheritance.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1481,7 +1481,7 @@ static void do_inherit_property(zend_property_info *parent_info, zend_string *ke
14811481
/* If we added props to the child property, we use the childs slot for
14821482
* storage to keep the parent slot set to null. This automatically picks
14831483
* the slow path in the JIT. */
1484-
bool use_parent_prop = (parent_info->hooks == NULL) == (child_info->hooks == NULL);
1484+
bool use_parent_prop = !parent_info->hooks && child_info->hooks;
14851485

14861486
if (child_info->offset != ZEND_VIRTUAL_PROPERTY_OFFSET) {
14871487
int parent_num = OBJ_PROP_TO_NUM(parent_info->offset);

0 commit comments

Comments
 (0)