getvalue() of multiple values field return only the first value
Drupal fields are represented by the ItemList class (whether they're multi-valued or not). The convenience method getValue() iterates through each item's getValue() method to build an array representation of the data value.

To retrieve a string representation of all the items in the list, you can use ItemList::getString(), which iterates through all the list items and calls getString() on each, then implodes them using ", " for glue.

So, for your example:

var_dump($user-&gt;field_mycustomfield-&gt;getString());


will output

string(14) "42, 66, 23, 77"