|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2017-12-14 17:16 UTC] 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 (...)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 05:00:01 2025 UTC |
Here's a very different test case that reproduces the same issue... function x() { $y = array(); foreach ($y as $z) { var_dump(array($z)); } }