function testMapMulti() { $a = array(1, 2, 3); $b = array("one", "two", "three"); $this->assertEquals(array(array(1, "one"), array(2, "two"), array(3, "three")), iterator_to_array(itertools\map(function ($a, $b) { return array($a, $b); }, itertools\to_iterator($a), itertools\to_iterator($b)))); }
protected function toIterator($value) { return itertools\to_iterator($value); }
function getTaskPrerequisites() { $app = $this->application; return itertools\filter(itertools\to_iterator($this->prerequisites), function ($task) use($app) { return $app->taskDefined($task); }); }