mirror of
https://github.com/php/php-src.git
synced 2026-03-26 01:02:25 +01:00
For rationale, see #6787 Extensions migrated in part 3: * ftp * gmp * iconv * opcache * shmop
36 lines
935 B
PHP
36 lines
935 B
PHP
--TEST--
|
|
Bug #75608 ("Narrowing occurred during type inference" error)
|
|
--EXTENSIONS--
|
|
opcache
|
|
--FILE--
|
|
<?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'];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
?>
|
|
OK
|
|
--EXPECT--
|
|
OK
|