Skip to content

Commit

Permalink
Merge branch 'PHP-7.0'
Browse files Browse the repository at this point in the history
* PHP-7.0:
  Restored the original (php-5) behavior of convert_to_cstring(). It was broken in php7 by mistake and caused problems in ext/pgsql/tests/bug46408.phpt.
  • Loading branch information
dstogov committed Oct 7, 2015
2 parents 311a3db + b8b335c commit e3c8d47
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Zend/zend_operators.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,16 @@ ZEND_API void ZEND_FASTCALL convert_to_boolean(zval *op) /* {{{ */

ZEND_API void ZEND_FASTCALL _convert_to_cstring(zval *op ZEND_FILE_LINE_DC) /* {{{ */
{
_convert_to_string(op ZEND_FILE_LINE_CC);
double dval;
if (Z_TYPE_P(op) == IS_DOUBLE) {
zend_string *str;
double dval = Z_DVAL_P(op);

str = zend_strpprintf(0, "%.*H", (int) EG(precision), dval);
ZVAL_NEW_STR(op, str);
} else {
_convert_to_string(op ZEND_FILE_LINE_CC);
}
}
/* }}} */

Expand Down

0 comments on commit e3c8d47

Please sign in to comment.