On 10/5/07, Jay Blanchard <jblanchard@xxxxxxxxxx> wrote: > > > It looks like PHP has an "unintentional feature". Doing this; if($r = > !$r) should always return TRUE because it is an assignment. I don't know > if I would rely on this. > > its not an unintentional operation; its the order of operations. logical ! and the ternary ? : takes precedence over the assignment statement = http://us.php.net/manual/en/language.operators.php personally, i wont argue w/ the compact nature of the statement; its nice. its mysterious statements like this that make code fragile, imho. i prefer the modulus approach. -nathan