Skip to content
Merged
Changes from all 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
2 changes: 1 addition & 1 deletion ext/pdo/pdo_stmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2360,7 +2360,7 @@ static int row_dim_exists(zend_object *object, zval *offset, int check_empty)
return false;
}
ZEND_ASSERT(retval == &tmp_val);
bool res = check_empty ? i_zend_is_true(retval) : Z_TYPE(tmp_val) != IS_NULL;
bool res = i_zend_is_true(retval);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for being confused as always, but where is it checked? What are the possible values for this parameter? For example, DOM checks 3 values https://github.com/php/php-src/blob/master/ext/dom/php_dom.c#L455

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit above you can see an if (!check_empty) which returns without reading the column.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Facepalm. I was looking at row_prop_exists

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries. For props the value of 2 for check_empty means checking if the property name exists without looking at its value. For dimensions, check_empty is a boolean

zval_ptr_dtor_nogc(retval);
return res;
} else {
Expand Down
Loading