bug75608.phpt 935 B

1234567891011121314151617181920212223242526272829303132333435
  1. --TEST--
  2. Bug #75608 ("Narrowing occurred during type inference" error)
  3. --EXTENSIONS--
  4. opcache
  5. --FILE--
  6. <?php
  7. class ReactionRatingService
  8. {
  9. public function calculateBoostPoints()
  10. {
  11. while ($reaction = $reactions) {
  12. $reactionRatings = $this->validFunction();
  13. $totalWeight = 0;
  14. $runningScore = 0;
  15. $queue = [];
  16. foreach ($reactionRatings as $ratingData) {
  17. if ($runningScore != $reaction['Score']) {
  18. if ( ! $ratingData['BoostEarned']) {
  19. $queue[] = $ratingData['UserID'];
  20. }
  21. } else {
  22. foreach ($queue as $userId) {
  23. $userBoostPointsRecalculate[$userId][] = $reaction['ID'];
  24. }
  25. }
  26. $totalWeight += $ratingData['Weight'];
  27. }
  28. }
  29. }
  30. }
  31. ?>
  32. OK
  33. --EXPECT--
  34. OK