@SuppressWarnings("unchecked")
	@Override
	public <T> T[] toArray(T[] array) {
	    int size = size();
        if (array.length < size) {
        	array = (T[]) java.lang.reflect.Array.newInstance(array.getClass().getComponentType(), size);
        }
        doGetAll(array, 0, size);
        if (array.length > size) {
        	array[size] = null;
        }
        return array;
	}
Returns an array containing the specified elements in this list.

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