File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1581,8 +1581,12 @@ void pdo_stmt_free_default_fetch_mode(pdo_stmt_t *stmt)
1581
1581
{
1582
1582
enum pdo_fetch_type default_fetch_mode = stmt -> default_fetch_type & ~PDO_FETCH_FLAGS ;
1583
1583
if (default_fetch_mode == PDO_FETCH_INTO ) {
1584
- ZEND_ASSERT (stmt -> fetch .into != NULL );
1585
- OBJ_RELEASE (stmt -> fetch .into );
1584
+ /* This can happen if the fetch flags are set via PDO::setAttribute()
1585
+ * $pdo->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_INTO);
1586
+ * See ext/pdo/tests/bug_38253.phpt */
1587
+ if (EXPECTED (stmt -> fetch .into != NULL )) {
1588
+ OBJ_RELEASE (stmt -> fetch .into );
1589
+ }
1586
1590
} else if (default_fetch_mode == PDO_FETCH_CLASS ) {
1587
1591
if (stmt -> fetch .cls .ctor_args != NULL ) {
1588
1592
zend_hash_release (stmt -> fetch .cls .ctor_args );
You can’t perform that action at this time.
0 commit comments