note 49959 added to function.is-bool

From: Date: Sun, 13 Feb 2005 19:41:46 +0000
Subject: note 49959 added to function.is-bool
Groups: php.notes 
Request: Send a blank email to php-notes+get-84936@lists.php.net to get a copy of this message
I think it's good to point out that is_bool() is the exact opposite of empty() and that is_bool() will return false if the variable it is checking is one of the following... $x = ""; $x = null; var $x; (not set) $x = array(); $x = false; $x = "0"; $x = (int) 0; Empty returns true for all of those. It's useful instead of typing !empty() and worrying. ---- Manual Page -- http://www.php.net/manual/en/function.is-bool.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+49959 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+49959&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+49959&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+49959&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+49959&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+49959&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+49959&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#84936) next »