Changing empty() to isset() for function array2object