in reply to detecting an undefined variable
This smells of the "PHP-ism" $$varname, which has long ago also been frowned-out by that community and with excellent reason. Don't try to inject arbitrary values into the variable-name space – use hashes instead.