Explicitly check if a struct has a name to avoid PHP Notice messages