note 54368 added to function.empty

From: Date: Fri, 01 Jul 2005 16:10:28 +0000
Subject: note 54368 added to function.empty
Groups: php.notes 
Request: Send a blank email to php-notes+get-91270@lists.php.net to get a copy of this message
empty($var) will return TRUE if $var is empty (according to the definition of 'empty' above) AND if $var is not set. I know that the statement in the "Return Values" section of the manual already says this in reverse: "Returns FALSE if var has a non-empty and non-zero value." but I was like "Why is this thing returning TRUE for unset variables???"... oh i see now... Its supposed to return TRUE for unset variables!!! <?php ini_set('error_reporting',E_ALL); ini_set('display_errors','1'); empty($var); ?> ---- Manual Page -- http://www.php.net/manual/en/function.empty.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+54368 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+54368&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+54368&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+54368&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+54368&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+54368&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+54368&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+54368&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#91270) next »