Re: [PHP-DEV] Boolean weirdness?

2001-05-17 Thread Andrei Zmievski
On Thu, 17 May 2001, Sebastian Bergmann wrote: > Hey there, > > I was just bitten by a - IMHO - weirdness with boolean values: > >$foo = -1; > if ($foo) { print "bar"; } > ?> > > The code above print 'bar'. I would expect if($x) t return true if $x > is an integer an

[PHP-DEV] Boolean weirdness?

2001-05-17 Thread Sebastian Bergmann
Hey there, I was just bitten by a - IMHO - weirdness with boolean values: 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