note 32321 deleted from language.types.boolean by bobby
| From: | bobby@php.net | Date: | Thu, 28 Sep 2006 15:15:07 +0000 |
| Subject: | note 32321 deleted from language.types.boolean by bobby | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-117781@lists.php.net to get a copy of this message | ||
Note Submitter: adama at NO-UBE dot augustinefam dot org
----
Just a correction to the 29-Apr-2003 10:49 posting. The first section of the comment, where
$myBool = true ; print( $myBool ) ;
is indistinguishable from
print( "" ) ;
likewise,
$myBool = false ; print( $myBool ) ;
is indistinguishable from
print( 1 ) ;
is backwards. It should actually be
$myBool = true ; print( $myBool ) ;
is indistinguishable from
print( 1 ) ; //corrected
likewise,
$myBool = false ; print( $myBool ) ;
is indistinguishable from
print( "" ) ; //corrected
The posting makes a good point, though. Don't expect the contents of a string to mean something
special. As the documentation states, any non-empty string is true, including "false"
since it is simply a non-empty string.