public function add($x, $y = 0) { if ($x instanceof Vector2) { return $this->add($x->x, $x->y); } else { return new Vector2($this->x + $x, $this->y + $y); } }