<?php $var = NULL; var_dump(isset($var)); // bool(false) var_dump(isset($unset_var)); // bool(false) ?>
isset($var) should return TRUE, since it has been set to NULL.
Is there any way to check for this?
Thanks!
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.
use get_defined_vars() to get an array of the variables defined in the current scope and then test against it with array_key_exists();
Edited:
if you wanted a function to test existence you would create one like so:
and use like so in any given scope:
Should work for any scope.