1
0
mirror of https://github.com/php/php-src.git synced 2026-04-25 17:08:14 +02:00

Merge branch 'PHP-7.2'

* PHP-7.2:
  Fixed bug #75687 (var 8 (TMP) has array key type but not value type)
This commit is contained in:
Xinchen Hui
2017-12-16 23:59:44 +08:00
2 changed files with 24 additions and 0 deletions
+3
View File
@@ -3371,6 +3371,9 @@ int zend_infer_types_ex(const zend_op_array *op_array, const zend_script *script
/* Ignore the constraint (either ce instanceof constraint->ce or
* they are unrelated, as far as we can statically determine) */
}
} else if ((tmp & MAY_BE_ANY) == 0) {
/* FIXME: usage in unreachable block */
tmp |= MAY_BE_UNDEF;
}
}
+21
View File
@@ -0,0 +1,21 @@
--TEST--
Bug #75687 (var 8 (TMP) has array key type but not value type)
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.optimization_level=-1
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
function x($y)
{
if (is_array($y)) {
$z = is_array($y) ? array() : array($y);
}
}
?>
okey
--EXPECT--
okey