/** * Resets all bits or one specific bit by position * @param int $pos optional */ public function reset($pos = null) { if (\is_int($pos)) { $this->offsetSet($pos, false); } else { $this->_List = ArrayList::repeat(false, $this->count()); } }
public function testRepeat() { $list = ArrayList::repeat('hello world', 100); $result = $list->every(function ($item) { return $item === 'hello world'; }); $this->assertCount(100, $list); $this->assertTrue($result); }