public function flatten()
    {
        $flattenedArray = [];
        array_walk_recursive($this->array, function ($item) use (&$flattenedArray) {
            $flattenedArray[] = $item;
        });
        $newInstance = new self();
        $newInstance->setArray($flattenedArray);
        return $newInstance;
    }
public function flatten()
    {
        $flattenedArray = [];
        array_walk_recursive($this->array, function ($item) use (&$flattenedArray) {
            $flattenedArray[] = $item;
        });
        $newInstance = new self();
        $newInstance->setArray($flattenedArray);
        return $newInstance;
    }
public function flatten ( ) { $ flattenedArray = [ ] ; array_walk_recursive ( $ this -> array , function ( $ item ) use ( & $ flattenedArray ) { $ flattenedArray [ ] = $ item ; } ) ; $ newInstance = new self ( ) ; $ newInstance -> setArray ( $ flattenedArray ) ; return $ newInstance ; }
Returns a new ArrayList containing an one-dimensional array of all elements of this ArrayList. Keys are going lost.
@return ArrayListInterface|ArrayListTrait
Returns a new ArrayList containing an one - dimensional array of all elements of this ArrayList . Keys are going lost .