--- a/src/Illuminate/Support/Collection.php +++ b/src/Illuminate/Support/Collection.php @@ -1232,6 +1232,7 @@ class Collection implements ArrayAccess, Arrayable, Jsonable, JsonSerializable, Countable, IteratorAggregate /** * Get an iterator for the items. */ + #[\ReturnTypeWillChange] public function getIterator() { return new ArrayIterator($this->items); @@ -1242,6 +1243,7 @@ class Collection implements ArrayAccess, Arrayable, Jsonable, JsonSerializable, Countable /** * Count the number of items in the collection. */ + #[\ReturnTypeWillChange] public function count() { return count($this->items);