@Override
	public E set(int index, E elem) {
    	checkIndex(index);
		return doSet(index, elem);
	}
Helper method for setting an element in the list.
This is the only method which really sets an element.
Override if you need to validity checks before setting.

@param index index where element will be placed
@param elem  element to set
@return      old element which was at the position
jphp-runtime/src/php/runtime/memory/support/IList.java