Defining constants with a value of 0?
| From: | Robert | Date: | Thu, 12 Jul 2001 15:12:15 +0000 |
| Subject: | Defining constants with a value of 0? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-57600@lists.php.net to get a copy of this message | ||
I'm running into some unexpected behavior that I can't figure out. This is
with PHP version 3, where, to my knowledge, boolean is not built in.
<?php define ("true", 1);
define ("false", 0);
echo gettype(true);
echo gettype(false); ?>
The type of true is returned as an integer, while the type of false is
returned as a string. Even if I say (int) 0, it still returns its type as a
string. Can anyone explain to me why it behaves this way? Thank you.
-Rob