/** * Create a new threader, 'thread last' by default in root namespace * * @return Thread */ public static function create($context) { $thread = new Thread($context); return $thread->threadLast()->inNamespace(''); }
public function testThreadingNthArgument() { $res = Thread::create(array(1, 2, 3))->threadNth(2)->array_map($this->inc)->threadNth(1)->array_filter($this->odd)->value(); $this->assertEquals(array(3), array_values($res)); }