You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ArrayUtils::iteratorToArray() has a different behaviour when $iterator is a Traversable object with a toArray() method.
When $recursive === false the method returns the result of its iterator, but when $recursive === true it returns the result of its toArray() method.
For a next major release I would suggest to make the method simplier without to handle objects with toArray() methods.
Another solution could be to return the toArray() even when $recursive === false.
…ay-different-behaviour-when-recursive-is-false
Fix#18 call `->toArray()` on `Traversable` instances given to `ArrayUtils::iteratorToArray()` only for instances which are **not** `Iterator` implementations
ArrayUtils::iteratorToArray()
has a different behaviour when$iterator
is aTraversable
object with atoArray()
method.When
$recursive === false
the method returns the result of its iterator, but when$recursive === true
it returns the result of itstoArray()
method.For a next major release I would suggest to make the method simplier without to handle objects with
toArray()
methods.Another solution could be to return the
toArray()
even when$recursive === false
.laminas-stdlib/src/ArrayUtils.php
Lines 233 to 247 in f0b299d
The text was updated successfully, but these errors were encountered: