drupal 7 user_load code example
Example: drupal 8 user_load
function user_load($uid, $reset = FALSE) {
if ($reset) {
\Drupal::entityManager()
->getStorage('user')
->resetCache(array(
$uid,
));
}
return User::load($uid);
}