combine() public method

Create a collection by using this collection for keys and another for its values.
public combine ( mixed $values ) : static
$values mixed
return static
Example #1
0
 public function testCombineWithCollection()
 {
     $expected = [1 => 4, 2 => 5, 3 => 6];
     $keyCollection = new Collection(array_keys($expected));
     $valueCollection = new Collection(array_values($expected));
     $actual = $keyCollection->combine($valueCollection)->toArray();
     $this->assertSame($expected, $actual);
 }