note 27379 added to function.empty

From: Date: Tue, 03 Dec 2002 23:09:51 +0000
Subject: note 27379 added to function.empty
Groups: php.notes 
Request: Send a blank email to php-notes+get-40315@lists.php.net to get a copy of this message
It does appear to be superfluous -- you're right. I assume you are saying that inside the function, it is impossible for the variable $var to be unset. That certainly makes sense, as that is a common behavior for other languages. I suppose when I wrote the function years ago I was just making sure I did not try to trim() and/or strlen() an unset variable, since it was not clear what PHP would do in such a case. Depending on a few emperical tests doesn't seem safe. I also suppose that if I looked long and hard, I *might* find someplace in some obscure corner of the PHP documentation some note about "local" variables to a function always being set, not unset. Great. I can simplify my function. -- http://www.php.net/manual/en/function.empty.php http://master.php.net/manage/user-notes.php?action=edit+27379 http://master.php.net/manage/user-notes.php?action=delete+27379 http://master.php.net/manage/user-notes.php?action=reject+27379

« previous php.notes (#40315) next »