note 14019 deleted from functions.php by jeroen
| From: | jeroen@php.net | Date: | Mon, 20 Aug 2001 19:15:00 +0000 |
| Subject: | note 14019 deleted from functions.php by jeroen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-16924@lists.php.net to get a copy of this message | ||
In the above example (by bart@framers.nl), the question is (indirectly) posed of how to
differentiate "" and 0 from the boolean true and false. PHP does this with the !== and
=== operators. These check for both (in)equality on value AND type.
So the example code could read
if (($somevar = foo()) !== false) {
do_something_on_success();
}
and it would work as wanted (only in PHP 4, though).
This is documented in language.operators.comparison.php so I suppose no real reason to write this
note :-)
/Troels Therkelsen
clueless@one2one-networks.com