コード例 #1
0
ファイル: pramda.php プロジェクト: kapolos/pramda
 public function testNth()
 {
     $this->assertEquals(1, P::nth(0, [1, 2, 3]));
     $this->assertEquals(2, P::nth(1, [1, 2, 3]));
     $this->assertEquals(NULL, P::nth(2, []));
     $this->assertEquals(3, P::nth(2, ["a" => 1, "b" => 2, "c" => 3]));
 }