]> granicus.if.org Git - php/commitdiff
Restored the original (php-5) behavior of convert_to_cstring(). It was broken in...
authorDmitry Stogov <dmitry@zend.com>
Wed, 7 Oct 2015 01:26:26 +0000 (04:26 +0300)
committerDmitry Stogov <dmitry@zend.com>
Wed, 7 Oct 2015 01:26:26 +0000 (04:26 +0300)
Zend/zend_operators.c

index 2345e0b2d440bf6041ad280be7d1cc0ad4403acf..f2378d84b6f59bee76bc1a317a7cacdbd16a4d10 100644 (file)
@@ -492,7 +492,16 @@ try_again:
 
 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);
+       }
 }
 /* }}} */