summaryrefslogtreecommitdiff
path: root/ext/opcache
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2017-07-18 20:41:01 +0300
committerDmitry Stogov <dmitry@zend.com>2017-07-18 20:41:01 +0300
commitc41d2535b1b4162de59f62bc52a74f7448ba0933 (patch)
tree572593d993a5decd34a121f80a38189ffae3bccd /ext/opcache
parentb01448f9a60145b65d3635c81146be66f2fd0325 (diff)
downloadphp-git-c41d2535b1b4162de59f62bc52a74f7448ba0933.tar.gz
Disabled compile-time constant DOUBLE to STRING evaluation (its result depends on run-time 'precision' setting)
Diffstat (limited to 'ext/opcache')
-rw-r--r--ext/opcache/Optimizer/zend_optimizer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/opcache/Optimizer/zend_optimizer.c b/ext/opcache/Optimizer/zend_optimizer.c
index afd1c15597..4b56809fda 100644
--- a/ext/opcache/Optimizer/zend_optimizer.c
+++ b/ext/opcache/Optimizer/zend_optimizer.c
@@ -163,7 +163,9 @@ int zend_optimizer_eval_cast(zval *result, uint32_t type, zval *op1) /* {{{ */
ZVAL_DOUBLE(result, zval_get_double(op1));
return SUCCESS;
case IS_STRING:
- if (Z_TYPE_P(op1) != IS_ARRAY) {
+ /* Conversion from double to string takes into account run-time
+ 'precision' setting and cannot be evaluated at compile-time */
+ if (Z_TYPE_P(op1) != IS_ARRAY && Z_TYPE_P(op1) != IS_DOUBLE) {
ZVAL_STR(result, zval_get_string(op1));
return SUCCESS;
}