public function append(value $value)
{
if ($value->parent !== null) {
throw new exceptions\runtime('Unable to append value because it has already a parent');
}
$value->parent = $this;
$this->values[] = $value;
if ($this->key === null) {
$this->key = 0;
}
$size = sizeof($value);
if ($size > 0) {
$value->rewind();
$this->size += $size;
$parent = $this->parent;
while ($parent !== null) {
$parent->size += $size;
$parent = $parent->parent;
}
}
return $this;
}