public function testConcat() { $l1 = new ArrayList([1, 2, 3]); $l2 = new ArrayList([4, 5, 6]); $l3 = $l1->concat($l2); $this->assertCount(6, $l3); }
public function offsetSet($offset, $value) { if (!\is_bool($value)) { throw new \InvalidArgumentException('$value is not a bool'); } //Expand the set if necessary if ($offset >= $this->count()) { $this->_List = $this->_List->concat(ArrayList::repeat(false, $offset - $this->count() + 1)); } $this->_List->offsetSet($offset, (bool) $value); }