What do you mean with
I need create post for anonymous user
“wp_get_current_user” only returns a valid output while a user is logged in, so forget this.
Do you want an form that creates posts with an “anonymous user” profile? Thats not possible. But you can create a User called anonymous and use this as post_author.