A->b->c might exist but c might not exist. How do I check it?
A->b->c
c
You could try:
if($A->b->c && $A->b->c != '')