A->b->c might exist but c might not exist. How do I check it?
A->b->c
c
If you have PHP 5.3, you can just use $a->count(). Otherwise, scippie's solution using @count($a->children()) works well. I find I don't need the @ but older PHP implementations may need it.
$a->count()
@count($a->children())