ArrayValue array,
@Reference Value arrayVar,
  public Value array_splice(Env env,			    ArrayValue array, //array gets spliced at offset                            int offset,                            @Optional("NULL") Value length,                            @Optional ArrayValue replace)  {    if (array == null)      return NullValue.NULL;        int size = array.getSize();    int startIndex = offset;    if (startIndex < 0)      startIndex += size;    int endIndex = size;    if (length != NullValue.NULL) {      endIndex = length.toInt();      if (endIndex < 0)        endIndex += size;      else        endIndex += startIndex;    }    return array.splice(startIndex, endIndex, replace);  }