Bug #75687 [NEW]: var 8 (TMP) has array key type but not value type

From: Date: Thu, 14 Dec 2017 17:16:45 +0000
Subject: Bug #75687 [NEW]: var 8 (TMP) has array key type but not value type
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-213101@lists.php.net to get a copy of this message
From: chris at ocproducts dot com Operating system: Mac OS High Sierra (fully patche PHP version: 7.2.0 Package: opcache Bug Type: Bug Bug description:var 8 (TMP) has array key type but not value type 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 bug report at https://bugs.php.net/bug.php?id=75687&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=75687&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=75687&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=75687&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=75687&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=75687&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=75687&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=75687&r=needscript Try newer version: https://bugs.php.net/fix.php?id=75687&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=75687&r=support Expected behavior: https://bugs.php.net/fix.php?id=75687&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=75687&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=75687&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=75687&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=75687&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=75687&r=dst IIS Stability: https://bugs.php.net/fix.php?id=75687&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=75687&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=75687&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=75687&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=75687&r=mysqlcfg

« previous php.bugs (#213101) next »