I would use property_exists() instead