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.
----
Server IP: 208.69.120.35
Probable Submitter: 64.124.65.175
----
Manual Page -- http:
//www.php.net/manual/en/function.unset.php
Edit -- https://master
.php.net/note/edit/78516
Del: integrated -- h
ttps://master.php.net/note/delete/78516/integrated
Del: useless -- http
s://master.php.net/note/delete/78516/useless
Del: bad code -- htt
ps://master.php.net/note/delete/78516/bad+code
Del: spam -- https:/
/master.php.net/note/delete/78516/spam
Del: non-english --
https://master.php.net/note/delete/78516/non-english
Del: in docs -- http
s://master.php.net/note/delete/78516/in+docs
Del: other reasons-- https://mast
er.php.net/note/delete/78516
Reject -- https://mast
er.php.net/note/reject/78516
Search -- https://
master.php.net/manage/user-notes.php
--
PHP Notes Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
.php
|