Qaribou\Collection\ImmArray::fromArray PHP 메소드

fromArray() 공개 정적인 메소드

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

Usage Example

예제 #1
0
 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