示例#1
0
文件: pramda.php 项目: kapolos/pramda
 public function testSize()
 {
     $a = function () {
         (yield 1);
         (yield 2);
         (yield 3);
     };
     $this->assertEquals(3, P::size($a()));
     $this->assertEquals(3, P::size([1, 2, 3]));
     $o = new StdClass();
     $o->a = 1;
     $o->b = 2;
     $o->c = 3;
     $this->assertEquals(3, P::size($o));
 }