summaryrefslogtreecommitdiff
path: root/ext/opcache/Optimizer/pass1_5.c
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2016-09-09 16:36:26 +0200
committerNikita Popov <nikic@php.net>2016-09-09 16:38:26 +0200
commite3c08de08adac203140be2f7855b5749147c0411 (patch)
tree1569dfabc89ef5ddf2ab061ae18d069d6e36e55a /ext/opcache/Optimizer/pass1_5.c
parent7a90fc96d86c06f7a6b22a1a64c7d87042baf1fc (diff)
downloadphp-git-e3c08de08adac203140be2f7855b5749147c0411.tar.gz
Don't optimize (string) cast on arrays
Otherwise we throw a notice during pass1_5 optimization.
Diffstat (limited to 'ext/opcache/Optimizer/pass1_5.c')
-rw-r--r--ext/opcache/Optimizer/pass1_5.c4
1 files changed, 3 insertions, 1 deletions
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 */