public function toArray() : array
    {
        $res = [];
        Iterators::each($this->iterator(), function ($element) use (&$res) {
            $res[] = $element;
        });
        return $res;
    }
public function toArray() : array
    {
        $res = [];
        Iterators::each($this->iterator(), function ($element) use (&$res) {
            $res[] = $element;
        });
        return $res;
    }
public function toArray ( ) : array { $ res = [ ] ; Iterators :: each ( $ this -> iterator ( ) , function ( $ element ) use ( & $ res ) { $ res [ ] = $ element ; } ) ; return $ res ; }
Converts this object to an array. This means it will iterate over this object.
It should be used only if it is reasonable.

@return array
Converts this object to an array . This means it will iterate over this object . It should be used only if it is reasonable .