示例#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]));
 }