I'm struggling trying to figure out how to add a Joomla 4 user via a PHP script. I have read the API docs and can't find an example script to follow. I need to figure out how to structure the user object and then the syntax to have Joomla\CMS\Factory process the object to add the user to the database. Any help would be appreciated.
https://docs.joomla.org/Accessing_the_current_user_object seems to say the utilities used to access the user object can be used to insert a new user. I can access a user's info, no problem. But I don't know how to structure a new from scratch user object and then how to get it inserted into the database.