Skip to content

Commit

Permalink
Disabled compile-time constant DOUBLE to STRING evaluation (its resul…
Browse files Browse the repository at this point in the history
…t depends on run-time 'precision' setting)
  • Loading branch information
dstogov committed Jul 18, 2017
1 parent b01448f commit c41d253
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ext/opcache/Optimizer/zend_optimizer.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit c41d253

Please sign in to comment.