[PHP-DEV] Boolean weirdness? From: Sebastian Bergmann (sb <email protected>)
Date: 05/17/01

  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.de

bonn.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>