Bug #75608 [Com]: Narrowing occurred during type inference

From: Date: Fri, 01 Dec 2017 14:05:37 +0000
Subject: Bug #75608 [Com]: Narrowing occurred during type inference
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-212863@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75608&edit=1 ID: 75608 Comment by: acm at tweakers dot net Reported by: anatoly dot pashin at gmail dot com Summary: Narrowing occurred during type inference Status: Open Type: Bug Package: *General Issues Operating System: centos PHP Version: 7.1.12 Block user comment: N Private report: N New Comment: We see the same issue (with the ppa version for ubuntu, 7.1.12-1, from https://launchpad.net/~ondrej/+archive/ubuntu/php). After stripping a class of pretty much all its functionality, we ended with this below php code. Note, the below code is actually not useful anymore. But just running 'php filename.php' triggers this warning: PHP Warning: Narrowing occurred during type inference. Please file a bug report on bugs.php.net in Unknown on line 0 <?php class ReactionRatingService { public function calculateBoostPoints() { while ($reaction = $reactions) { $reactionRatings = $this->validFunction(); $totalWeight = 0; $runningScore = 0; $queue = []; foreach ($reactionRatings as $ratingData) { if ($runningScore != $reaction['Score']) { if ( ! $ratingData['BoostEarned']) { $queue[] = $ratingData['UserID']; } } else { foreach ($queue as $userId) { $userBoostPointsRecalculate[$userId][] = $reaction['ID']; } } $totalWeight += $ratingData['Weight']; } } } } Previous Comments: ------------------------------------------------------------------------ [2017-12-01 10:07:34] laruence@php.net the error seems not in YiiBase.php but the file which is trying to include in line 421 could you please try to figure out which file it was trying to include? thanks ------------------------------------------------------------------------ [2017-12-01 02:03:00] 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) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=75608&edit=1

« previous php.bugs (#212863) next »