note 28708 deleted from function.empty by aidan

From: Date: Mon, 24 Jan 2005 14:33:40 +0000
Subject: note 28708 deleted from function.empty by aidan
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-83863@lists.php.net to get a copy of this message
Note Submitter: Dan Hansen ---- As far as I can tell, the only useful purpose of empty() is to do this: if (!$var) { do_something(); } without getting a NOTICE error. This code will return no errors with error_reporting(E_ALL): if (empty($var)) { do_something(); } The isset() function is very helpful to find if a form field was submitted as blank. I could give an example but I think somebody alreay did in here. My point is that isset() and empty() are redundant but they do allow you to program in error_reporting(E_ALL) without warnings or notices, which usually means more secure scripts...

« previous php.notes (#83863) next »