public function removeAtIndexInPriority($index, $priority = null)
{
if ($this->getReadOnly()) {
throw new TInvalidOperationException('list_readonly', get_class($this));
}
if ($priority === null) {
$priority = $this->getDefaultPriority();
}
$priority = (string) round(TPropertyValue::ensureFloat($priority), $this->_p);
if (!isset($this->_d[$priority]) || $index < 0 || $index >= count($this->_d[$priority])) {
throw new TInvalidDataValueException('list_item_inexistent');
}
// $value is an array of elements removed, only one
$value = array_splice($this->_d[$priority], $index, 1);
$value = $value[0];
if (!count($this->_d[$priority])) {
unset($this->_d[$priority]);
}
$this->_c--;
$this->_fd = null;
return $value;
}