Assigning an existing default 'registerd' role for a new application

PHP script to assign specific default role for a new application to each existing user

See a PHP snippet

https://gist.github.com/anonymous/e53750e2319cfa09a30515e6cbb097dc