protected void checkIndex(int index) {
		if (index < 0 || index >= size()) {
			throw new IndexOutOfBoundsException("Invalid index: " + index + " (size: " + size() + ")");
		}
	}
Check that specified index is valid for getting/setting elements.

@param index	index to check
@throws IndexOutOfBoundsException if index is invalid
jphp-runtime/src/php/runtime/memory/support/IList.java