note 95908 deleted from language.types.boolean by danbrown
| From: | danbrown@php.net | Date: | Thu, 28 Jan 2010 13:16:30 +0000 |
| Subject: | note 95908 deleted from language.types.boolean by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-165408@lists.php.net to get a copy of this message | ||
Note Submitter: codiemorgan at gmail.com
----
Correction for "russell dot harper at springboardnetworks dot com".
0.0 does return false, because 0.0 = 0.
the reason you are getting a TRUE from your value is because your are putting 0.0 inside a string.
yours: print '0.0'."\t".((bool)'0.0'? 1: 0)."\n";
try: print 0.0."\t".((bool)0.0? 1: 0)."\n";
"0.0" => true; Because it is a non empty string.
'0.0' => true; Because it is a non empty string.
0.0 => false; because it is a value equal to 0.
for "" = false while "0.0" and "200" = true;