summaryrefslogtreecommitdiff
path: root/ext/opcache/tests/bug75608.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/opcache/tests/bug75608.phpt')
-rw-r--r--ext/opcache/tests/bug75608.phpt33
1 files changed, 33 insertions, 0 deletions
diff --git a/ext/opcache/tests/bug75608.phpt b/ext/opcache/tests/bug75608.phpt
new file mode 100644
index 0000000000..875e102ac8
--- /dev/null
+++ b/ext/opcache/tests/bug75608.phpt
@@ -0,0 +1,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