summaryrefslogtreecommitdiff
path: root/ext/opcache/tests/bug75608.phpt
blob: 875e102ac8b2a4dd5202a4be2fceff8dc9c99551 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
--TEST--
Bug #75608 ("Narrowing occurred during type inference" error)
--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