Replies: 2 comments 6 replies
-
interesting idea. Is there a specific use case where you thought it would be helpful? My concerns with this are:
$col1 = Collection::fromIterable([1, 2, 3]); // this is clear, I get Collection([1, 2, 3])
/**
* This one is not super clear, am I getting:
* A) Collection([1, 2, 3, 4, 5, 6]) -> the iterables get merged
* B) Collection(Collection([1, 2, 3]), Collection([4, 5, 6])) -> I get a collection where each iterable gets put into a collection
* C) Collection([[1, 2, 3], [4, 5, 6]]) -> I get a collection where each iterable is kept in a separate iterable (e.g. an array)
*/
$col2 = Collection::fromIterable([1, 2, 3], [4, 5, 6]); |
Beta Was this translation helpful? Give feedback.
3 replies
-
So on this, would it be for other constructors or only for |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm just throwing this here so I don't forget!
What do you think about having variadic static constructors?
from:
public static function fromIterable(iterable $iterable): self
to:
public static function fromIterable(iterable ...$iterable): self
Beta Was this translation helpful? Give feedback.
All reactions