From: Nikita Popov Date: Fri, 9 Sep 2016 14:36:26 +0000 (+0200) Subject: Don't optimize (string) cast on arrays X-Git-Tag: php-7.1.0RC2~37^2^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e3c08de08adac203140be2f7855b5749147c0411;p=php Don't optimize (string) cast on arrays Otherwise we throw a notice during pass1_5 optimization. --- diff --git a/ext/opcache/Optimizer/pass1_5.c b/ext/opcache/Optimizer/pass1_5.c index 53abb5b3bd..1a0fdb5415 100644 --- a/ext/opcache/Optimizer/pass1_5.c +++ b/ext/opcache/Optimizer/pass1_5.c @@ -106,7 +106,9 @@ void zend_optimizer_pass1(zend_op_array *op_array, zend_optimizer_ctx *ctx) if (ZEND_OP1_TYPE(opline) == IS_CONST && opline->extended_value != IS_ARRAY && opline->extended_value != IS_OBJECT && - opline->extended_value != IS_RESOURCE) { + opline->extended_value != IS_RESOURCE && + (opline->extended_value != IS_STRING + || Z_TYPE(ZEND_OP1_LITERAL(opline)) != IS_ARRAY)) { /* cast of constant operand */ zend_uchar type = opline->result_type; uint32_t tv = ZEND_RESULT(opline).var; /* temporary variable */