public function testZipAssoc() { $this->assertEquals(['a' => 1, 'b' => 2], P::toArray(P::zipAssoc(['a', 'b'], [1, 2]))); $z1 = P::zipAssoc(['a', 'b']); $this->assertEquals(['a' => 1, 'b' => 2], P::toArray($z1([1, 2]))); $this->assertEquals([], P::toArray(P::zipAssoc([], [1, 2]))); $a = function () { (yield 'a'); (yield 'b'); }; $b = function () { (yield 1); (yield 2); }; $this->assertEquals(['a' => 1, 'b' => 2], P::toArray(P::zipAssoc($a(), $b()))); }