What settings should be changed while setting up php WAMP so that undefined variable error are not encountered?
I changed the setting register_globals = on but it did not help.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You are probably looking for this
php.inisetting:it should be the default setting in a fresh install, though.
The best way, however, is always to change your scripts so
undefined variablenotices aren’t thrown in the first place.Notices sometimes contain valuable information that is impossible to find in a sea of meaningless “undefined variable” notices; and even if notices and warnings are suppressed, they slow down the script’s execution! So the right thing is to prevent them from the start if at all possible.
You can check for the existence of each variable using
isset()orempty()before using it to preventundefined variablenotices from happening.