Get id from parent in subpanel

I did a print_r on the bean, the data I need is there, but it’s very deep, I got to a certain point, but I can’t retrieve it:

$bean-><relationship_ name>->beans

and here I find:

[b0c403b7-24ac-7ec9-742a] => <ModuleA> Object
        (
            ...
            [id] => b0c403b7-24ac-7ec9-742a
            ...

I don’t know how to reach [id]