|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2017-12-01 02:03 UTC] anatoly dot pashin at gmail dot com
Description: ------------ Today we updated php to 7.1.12 and saw some errors during deploy. Deploy algo: 1. get new files in /www/versions/795.17 directory 2. change symbolic link so it points to it 3. call php-fpm reload. Error is thrown for some requests after 1-2 minute after reload. You can see source of YiiBase.php at https://github.com/yiisoft/yii/blob/master/framework/YiiBase.php Please tell me email which I can send SpDelivery.php privately. Test script: --------------- System_PhpException: Uncaught exception 'System_PhpException' with message 'Narrowing occurred during type inference. Please file a bug report on bugs.php.net' in /www/versions/795.17/vendor/yiisoft/yii/framework/YiiBase.php:421 in System_Global::{closure} called at /www/versions/795.17/vendor/yiisoft/yii/framework/YiiBase.php (421) in include called at /www/versions/795.17/vendor/yiisoft/yii/framework/YiiBase.php (421) in YiiBase::autoload called at ? (?) in spl_autoload_call called at /www/versions/795.17/src/DeliveryCalculator/SpDelivery.php (67) in Sp\DeliveryCalculator\SpDelivery::detectTariffs called at /www/versions/795.17/src/DeliveryCalculator/SpDelivery.php (21) in Sp\DeliveryCalculator\SpDelivery::getCalculation called at /www/versions/795.17/protected/models/Distributors.php (982) in Distributors::getMinimalDeliveryCalculation called at /www/versions/795.17/protected/components/SHtml.php (1618) in SHtml::getDeliverySummary called at /www/versions/795.17/public_html/includes/classes/Widgets/Layout.php (65) in Widgets_Layout::getHeader called at /www/versions/795.17/public_html/includes/classes/Widgets/HtmlPage.php (213) in Widgets_HtmlPage::printHeader called at /www/versions/795.17/public_html/ui/megaorder.php (103) PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 21:00:02 2025 UTC |
Laruence, I know problem is not in YiiBase.php :) it tries to include SpDelivery.php, which I can't post here. If you agree to not share it, I can email it to you privately. I can't determine which part of code in SpDelivery.php causes issue, because error goes away from time to time when I try to edit that file. So I change any line, error gone. I change another one and it's returned. About file acm at tweakers dot net posted: I can't reproduce it from cli (because opcache is disabled in cli). I see 'Narrowing occurred during type inference' error message when I try to open it from webroot through php-fpm. But when I press f5 to refresh page, error is gone and script is executed successfully. PHP 7.1.12 (cli) (built: Dec 1 2017 14:08:55) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies with Zend OPcache v7.1.12, Copyright (c) 1999-2017, by Zend Technologies with Xdebug v2.5.5, Copyright (c) 2002-2017, by Derick RethansLaruence, I managed to get minimal reproducible example. Following code produces warning constantly. class DeliveryTariffs extends BaseActiveRecord { public static function foo($arg1, $arg2 = null) { $a = self::someMethod(); $b = []; foreach ($a as $c) { foreach ($b as $d => $e) { if (count(array_intersect($e['f'], $j['f'])) / min(count($e['f']), count($j['f'])) > 0.5) { $b[$d]['g'][$h] = $j['g'][$h]; $i = true; break; } } if (!$i) { $b[] = $j; } } return $b; } }