diff options
Diffstat (limited to 'ext/pdo/pdo_stmt.c')
-rw-r--r-- | ext/pdo/pdo_stmt.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 7ea0f6df0f..e1c51ef29a 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -616,6 +616,13 @@ static inline void fetch_value(pdo_stmt_t *stmt, zval *dest, int colno, int *typ if (stmt->dbh->stringify) { switch (Z_TYPE_P(dest)) { + case IS_FALSE: + /* Return "0" rather than "", because this is what database drivers that + * don't have a dedicated boolean type would return. */ + zval_ptr_dtor_nogc(dest); + ZVAL_INTERNED_STR(dest, ZSTR_CHAR('0')); + break; + case IS_TRUE: case IS_LONG: case IS_DOUBLE: convert_to_string(dest); |