|  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
47 + 48 = ?
Subscribe to this entry?

 [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-2022 The PHP Group
All rights reserved.
Last updated: Thu Dec 01 03:05:53 2022 UTC