summaryrefslogtreecommitdiff
path: root/ext/pdo/php_pdo_driver.h
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2015-08-30 05:31:36 -0700
committerXinchen Hui <laruence@gmail.com>2015-08-30 05:32:37 -0700
commit014abbc84050a52a49b62395c7fdf752c142b843 (patch)
treebbabb1e96bbd76ab045f7b6132f95d64d3917ab1 /ext/pdo/php_pdo_driver.h
parentd7cd2d7bd68c611a9276716fdb8b866f3c6933c2 (diff)
parentef1bd8f0e6f88b1d123cea1c0b5079cfde7f90df (diff)
downloadphp-git-014abbc84050a52a49b62395c7fdf752c142b843.tar.gz
Merge branch 'PHP-5.6'
Conflicts: ext/pdo/pdo_dbh.c ext/pdo/php_pdo_driver.h
Diffstat (limited to 'ext/pdo/php_pdo_driver.h')
-rw-r--r--ext/pdo/php_pdo_driver.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/ext/pdo/php_pdo_driver.h b/ext/pdo/php_pdo_driver.h
index efa21a4e14..57b2d7b8b0 100644
--- a/ext/pdo/php_pdo_driver.h
+++ b/ext/pdo/php_pdo_driver.h
@@ -199,20 +199,18 @@ static inline zend_long pdo_attr_lval(zval *options, enum pdo_attribute_type opt
zval *v;
if (options && (v = zend_hash_index_find(Z_ARRVAL_P(options), option_name))) {
- convert_to_long_ex(v);
- return Z_LVAL_P(v);
+ return zval_get_long(v);
}
return defval;
}
-static inline char *pdo_attr_strval(zval *options, enum pdo_attribute_type option_name, char *defval)
+static inline zend_string *pdo_attr_strval(zval *options, enum pdo_attribute_type option_name, zend_string *defval)
{
zval *v;
if (options && (v = zend_hash_index_find(Z_ARRVAL_P(options), option_name))) {
- convert_to_string_ex(v);
- return estrndup(Z_STRVAL_P(v), Z_STRLEN_P(v));
+ return zval_get_string(v);
}
- return defval ? estrdup(defval) : NULL;
+ return defval ? zend_string_copy(defval) : NULL;
}
/* }}} */