While you can do:
echo $child['name'];
to see the value, you should note that $child['name'] is an object, not a string. Echoing it casts it to a string, so it works in that situation. But if you're storing it somewhere, it's better to cast it to a string yourself:
$name = (string) $child['name'];