public function testApply() { $range = range(0, 5); $result = []; apply(function ($n) use(&$result) { $result[] = $n; }, $range); $this->assertSame([0, 1, 2, 3, 4, 5], $result); }