Qaribou\Collection\ImmArray::fromArray PHP Method

fromArray() public static method

Build from an array
public static fromArray ( array $arr ) : ImmArray
$arr array
return ImmArray
    public static function fromArray(array $arr)
    {
        return new static(SplFixedArray::fromArray($arr));
    }

Usage Example

 public function testConcat()
 {
     $setA = ImmArray::fromArray([1, 2, 3]);
     $setB = ImmArray::fromItems(new ArrayIterator([4, 5, 6]));
     $concatted = $setA->concat($setB);
     $this->assertSame([1, 2, 3, 4, 5, 6], $concatted->toArray());
 }
All Usage Examples Of Qaribou\Collection\ImmArray::fromArray