Date: 05/17/01
- Next message: Andrei Zmievski: "Re: [PHP-DEV] Boolean weirdness?"
- Previous message: Sterling Hughes: "[PHP-DEV] Re: Exporting strlcat()?"
- Next in thread: Andrei Zmievski: "Re: [PHP-DEV] Boolean weirdness?"
- Reply: Andrei Zmievski: "Re: [PHP-DEV] Boolean weirdness?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hey there,
I was just bitten by a - IMHO - weirdness with boolean values:
<?php
$foo = -1;
if ($foo) { print "bar"; }
?>
The code above print 'bar'. I would expect if($x) t return true if $x
is an integer and greater that zero. This is what my intuition tells me
:)
Just a thought,
Sebastian
-- sebastian bergmann sb <email protected> http://www.sebastian-bergmann.debonn.phpug.de | www.php.net | www.phpOpenTracker.de | www.titanchat.de
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Andrei Zmievski: "Re: [PHP-DEV] Boolean weirdness?"
- Previous message: Sterling Hughes: "[PHP-DEV] Re: Exporting strlcat()?"
- Next in thread: Andrei Zmievski: "Re: [PHP-DEV] Boolean weirdness?"
- Reply: Andrei Zmievski: "Re: [PHP-DEV] Boolean weirdness?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

