|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75681 Warning: Narrowing occurred during type inference (specific case)
Submitted: 2017-12-14 02:54 UTC Modified: 2017-12-16 20:26 UTC
From: chris at ocproducts dot com Assigned: nikic (profile)
Status: Closed Package: opcache
PHP Version: 7.2.0 OS: Mac OS High Sierra (fully patche
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: chris at ocproducts dot com
New email:
PHP Version: OS:


 [2017-12-14 02:54 UTC] chris at ocproducts dot com
Running on the latest of everything, the attached reduced test case fails when opcache is enabled.

"Warning: Narrowing occurred during type inference. Please file a bug report on in Unknown on line 0"

It is affecting Composr CMS, we found it from in the wild for customer(s) upgraded to PHP 7.2.

This is not fixed by these commits:
I also confirmed it is not fixed in git HEAD.

Test script:

function foobar()
    do {
        foreach ($a as $i => $_) {
            $a[$i][0] += 1;

        $a[] = array(0, 0);
    } while ($x !== false);


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-12-14 03:00 UTC] chris at ocproducts dot com
Weirdly the fixes do seem to have corrected the issue in the original context in my code.
Only my test case now fails.
 [2017-12-16 20:26 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: nikic
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Dec 07 18:01:29 2023 UTC