Beispiel #1
0
 public function test_chain_finite_streams_into_empty_stream()
 {
     $capture = function ($x) use(&$vals) {
         $vals[] = $x;
     };
     $t = new Stream(10, function () {
         return new Stream(20, function () {
             return new Stream(30, function () {
                 return new Stream();
             });
         });
     });
     $vals = array();
     $t->walk($capture);
     $this->assertEquals(array(10, 20, 30), $vals);
 }