Drupal 8, get value of field user in proper way, not an array
The method getValue() is used to get an array:

$array = $user-&gt;get('field_value')-&gt;getValue();


If you want to get a skalar use:

$value = $user-&gt;get('field_value')-&gt;value;


Both methods look similar, but do different things:

The method getValue() is to get the complete array of a field, which is quite useful for multiple value fields or multiple properties.

The method -&gt;value gets the property with the same name.  Most standard fields use value as the main property.