Bug #75687 [Opn->Csd]: var 8 (TMP) has array key type but not value type

From: Date: Sat, 16 Dec 2017 16:00:01 +0000
Subject: Bug #75687 [Opn->Csd]: var 8 (TMP) has array key type but not value type
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-213129@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75687&edit=1 ID: 75687 Updated by: laruence@php.net Reported by: chris at ocproducts dot com Summary: var 8 (TMP) has array key type but not value type -Status: Open +Status: Closed Type: Bug Package: opcache Operating System: Mac OS High Sierra (fully patche PHP Version: 7.2.0 Block user comment: N Private report: N New Comment: Automatic comment on behalf of laruence@gmail.com Revision: http://git.php.net/?p=php-src.git;a=commit;h=a20c9bd3fec9b1df83193ae0db18cb04064461e3 Log: Fixed bug #75687 (var 8 (TMP) has array key type but not value type) Previous Comments: ------------------------------------------------------------------------ [2017-12-14 17:31:37] chris at ocproducts dot com Here's a very different test case that reproduces the same issue... function x() { $y = array(); foreach ($y as $z) { var_dump(array($z)); } } ------------------------------------------------------------------------ [2017-12-14 17:16:44] chris at ocproducts dot com Description: ------------ The following test case produces noise when a lint is done, although the lint does ultimately pass. Clearly the code is doing something unnecessary, but I don't believe opcache should be complaining about it. This affects PHP 5.2 and also current git HEAD. Test script: --------------- <?php function x($y) { if (is_array($y)) { $z = is_array($y) ? array() : array($y); } } Expected result: ---------------- No syntax errors detected in (...) Actual result: -------------- In function ::x (after sccp): var 8 (TMP) has array key type but not value type var 9 (TMP) has array key type but not value type var 10 (TMP) has array key type but not value type var 11 (CV $z) has array key type but not value type No syntax errors detected in (...) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=75687&edit=1

« previous php.bugs (#213129) next »