public E[] getArray(int index, int len) {
        checkRange(index, len);

        @SuppressWarnings("unchecked")
        E[] array = (E[]) new Object[len];
        for (int i=0; i<len; i++) {
            array[i] = doGet(index+i);
        }
        return array;
    }
Returns specified range of elements from list as array.

@param index index of first element to retrieve
@param len   number of elements to retrieve
@return      array containing the specified range of elements
jphp-runtime/src/php/runtime/memory/support/IList.java