how to pull parent term from nested array? I'm building a custom field and formatter in Drupal 8(and teaching myself how to use Drupal &amp; PHP, so bear with me)

I'm not sure how to pull a parent term 'name' value from a nested array. 

Right now, I've got this: 

$tid = 15
$parent = \Drupal::entityTypeManager()-&gt;getStorage('taxonomy_term')-&gt;loadParents($tid);


But I'm not sure how to get the 'name' field so I can use it in my #markup. 

I used var_dump to see what was there (can't use kint at the moment. Devel caused issues with some other modules)

Here's the array that came back: 

array(1) { 
[3]=&gt; object(Drupal\taxonomy\Entity\Term)#1187 (26) { 
    ["values":protected]=&gt; array(9) { 
        ["tid"]=&gt; array(1) { 
            ["x-default"]=&gt; string(1) "3" 
        } 

        ["vid"]=&gt; array(1) { 
            ["x-default"]=&gt; string(10) "plant_part" 
        } 

        ["uuid"]=&gt; array(1) { 
            ["x-default"]=&gt; string(36) "2xxxxxx6-5xxb-2xx5-8xx7-axxxxxxxxc" 
        } 

        ["langcode"]=&gt; array(1) { 
            ["x-default"]=&gt; string(2) "en" 
        } 

        ["name"]=&gt; array(1) { 
            ["x-default"]=&gt; string(11) "Term wanted" 
        } 


I was trying something like this, but no luck:

 $parent['values']['tid']['x-default']
If you check closely with the var_dump() output, you will see, that you actually load an array of entity objects with the type taxonomy term: https://api.drupal.org/api/drupal/core%21modules%21taxonomy%21src%21Entity%21Term.php/class/Term/8.5.x

This object has a getter method getName() that returns the desired property:

$names = [];

foreach($parent as $term) {
  $names[] = $term-&gt;getName();
}

$names_list = implode(', ', $names);