latheesan
12-22-2009, 02:31 PM
Hello,
I am working on a script with the following error reporting level:
E_STRICT | E_ALL
This is my script:
function isValidCountryName ($inValue) {
for ($i = 0; $i < __totalCountryList; $i++) {
if (defined(__countryList . $i) && constant(__countryList . $i) == $inValue) {
// Country Name is Valid
return true;
}
}
// Country Name is NOT Valid
return false;
}
if (isValidCountryName('France')) {
// valid
} else {
// not defined
}
This is the notice php generating :
Notice: Use of undefined constant __countryList - assumed '__countryList' in C:\xampp\htdocs\site\activate.php on line 23
Notice: Use of undefined constant __countryList - assumed '__countryList' in C:\xampp\htdocs\site\activate.php on line 23
Notice: Use of undefined constant __countryList - assumed '__countryList' in C:\xampp\htdocs\site\activate.php on line 23
etc...
Any idea why it's doing this?
I am working on a script with the following error reporting level:
E_STRICT | E_ALL
This is my script:
function isValidCountryName ($inValue) {
for ($i = 0; $i < __totalCountryList; $i++) {
if (defined(__countryList . $i) && constant(__countryList . $i) == $inValue) {
// Country Name is Valid
return true;
}
}
// Country Name is NOT Valid
return false;
}
if (isValidCountryName('France')) {
// valid
} else {
// not defined
}
This is the notice php generating :
Notice: Use of undefined constant __countryList - assumed '__countryList' in C:\xampp\htdocs\site\activate.php on line 23
Notice: Use of undefined constant __countryList - assumed '__countryList' in C:\xampp\htdocs\site\activate.php on line 23
Notice: Use of undefined constant __countryList - assumed '__countryList' in C:\xampp\htdocs\site\activate.php on line 23
etc...
Any idea why it's doing this?
