<U, V>Unzips an option containing a tuple of two options.
If self is Some([a, b]) this method returns [Some(a), Some(b)]. Otherwise, [None, None] is returned.
$x = Option\Some("vegetables");
self::assertEq(Option\unzip(Option\some(["a", 2])), [Option\some("a"), Option\some(2)]);
self::assertSame(Option\unzip(Option\none()), [Option\none(), Option\none()]);
| Parameters | |||
|---|---|---|---|
Option<array{U, V}>
|
$option |
# | |
| Returns | |
|---|---|
array{Option<U>, Option<V>}
|
|