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:10 +08:00
parent eb77c2c2a7
commit a20c9bd3fe
3 changed files with 28 additions and 0 deletions

4
NEWS
View File

@ -5,6 +5,10 @@ PHP NEWS
- Core:
. Fixed bug #75679 (Path 260 character problem). (Anatol)
- Opcache:
. Fixed bug #75687 (var 8 (TMP) has array key type but not value type).
(Laruence)
- PGSQL:
. Fixed bug #75671 (pg_version() crashes when called on a connection to
cockroach). (magicaltux at gmail dot com)

View File

@ -3338,6 +3338,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;
}
}

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