Create a user using a single PHP file
If you want a single php file you can use a drush shell script:

#!/usr/bin/env drush

use Drupal\user\Entity\User;

    $user = User::create(['name' =&gt; 'testuser', 'status' =&gt; TRUE]);
    $user-&gt;save();


For more information see https://github.com/drush-ops/drush/blob/master/docs/shellscripts.md

A better approach might be to use REST, see https://www.drupal.org/node/2754633