Unnamed
public php v1 · immutable<?phpclass A{ public function add ($element) { if (!$this->readOnly) { $new_elements = new Elements($this->size + 1); for ($i = 0; $i < $this->size; $i++) { $new_elements->setIndex($i, $this->elements->getIndex($i)); } $this->elements = $new_elements; $this->elements->setIndex($this->size++, $element); } } }