コード例 #1
0
ファイル: pramda.php プロジェクト: kapolos/pramda
 public function testPluck()
 {
     $a = function () {
         (yield ['a' => 1, 'b' => 2]);
         (yield ['a' => 3, 'b' => 4]);
     };
     $b1 = [1, 2, 3];
     $b2 = [4, 5, 6];
     $this->assertEquals([2, 4], P::toArray(P::pluck('b', $a())));
     $this->assertEquals([2, 5], P::toArray(P::pluck(1, [$b1, $b2])));
 }