Bug #75630 [Com]: Narrowing occurred during type inference
| From: | m dot sevastyanov at s7 dot ru | Date: | Tue, 05 Dec 2017 10:40:23 +0000 |
| Subject: | Bug #75630 [Com]: Narrowing occurred during type inference | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-212936@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=75630&edit=1
ID: 75630
Comment by: m dot sevastyanov at s7 dot ru
Reported by: m dot sevastyanov at s7 dot ru
Summary: Narrowing occurred during type inference
Status: Feedback
Type: Bug
Package: opcache
Operating System: Linux/Windows
PHP Version: 7.1.12
Block user comment: N
Private report: N
New Comment:
Looks like this one is related:
https://bugs.php.net/bug.php?id=75627
Previous Comments:
------------------------------------------------------------------------
[2017-12-05 10:04:25] requinix@php.net
Please review the existing bugs to determine if any are relevant to you.
https://bugs.php.net/search.php?search_for=%22Narrowing+occurred+during+type+inference%22&boolean=2&cmd=display&status=All
------------------------------------------------------------------------
[2017-12-05 10:00:07] m dot sevastyanov at s7 dot ru
Description:
------------
We get these strange errors when trying to require() or include() some classes.
I managed to extract some script part enough to reproduce it.
Test script:
---------------
php.ini:
opcache.enable_cli=1
narrowing.php:
<?php
class TestClass
{
public function test()
{
$seqs = [];
foreach ([] as $row) {
foreach ($seqs as $i => $seq)
$seqs[$i][] = 0;
$seqs[] = 0;
}
}
}
php -c php.ini narrowing.php
Expected result:
----------------
no warning/error
Actual result:
--------------
Warning: Narrowing occurred during type inference. Please file a bug report on bugs.php.net in
Unknown on line 0
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=75630&edit=1