Isset and PHP Global Variable
- by justjoe
i have doubt on this particular problem : Global variabe initiation. i got this code and has global variable named conditional_random here :
function hello_testing() {
global $conditional_random;
if (isset($conditional_random)) {
echo "foo is inside";
}
}
As it's name, the global variable (conditional_random) can be or not initiate before the hello_testing function been called.
So, what happen to my validation via isset() when $conditional_random is not initiate before the hello_testing function ? will it failed to check or it will always be true cause by the 'global' ?