Note that since unset() returns void, you can't do this:
isset($some_var) && unset($some_var);
You'll get: Parse error: syntax error, unexpected T_UNSET in ...
The reason is because it would parse as
<bool> && <void>;
which is not a valid PHP statement.
Thus, the only alternative is to actually use if statement.
isset($some_var) && unset($some_var);
You'll get: Parse error: syntax error, unexpected T_UNSET in ...
The reason is because it would parse as
<bool> && <void>;
which is not a valid PHP statement.
Thus, the only alternative is to actually use if statement.