In other programming languages (Python, Ruby, Scheme), I'm used to doing things like
$foo = $cat && $dog;
$bar = $fruit || $vegetable;
I would expect that $foo would get assigned to $dog if $cat were null, and $bar to $fruit if $fruit were NOT null. I seem to recall getting burned for doing things like this in PHP, and I've never learned exactly how logical operators handle non-boolean operands. Can someone explain or point me in the right direction? I tried reading the following page in the official docs, but it doesn't deal with non-booleans: