latitude = (float) $array['lat']; $instance->longitude = (float) $array['lon']; return $instance; } public function isSame(Point $other): bool { $isSame = ( ($other->latitude === $this->latitude) and ($other->longitude === $this->longitude) ); return $isSame; } }