public function offsetSet($offset, $value) { if (is_null($offset)) { $this->points[] = $value; } else { $this->points[$offset] = $value; } }