since undefined equates to false, i am wondering if there are any draw backs to replacing the following code:
public static function user_access_level() {
if (isset($_SESSION['lev_user_access'])) {
return $_SESSION['lev_user_access'];
} else {
return false;
}
}
with:
public static function user_access_level() {
return $_SESSION['lev_user_access'];
}
You will get a warning, if you have
E_WARNING(orE_ALL, which you should be coding with).You could use a ternary operator…