How to get from a variable its class and name if it is not initialized?