in reply to Re: variable set to 0 ? 0 : 1
in thread variable set to 0 ? 0 : 1

or if you only want to return 1 and 0 instead of just "true" and "false":
return $status ? 1 : 0;

I know this is a bit of a dead horse but someone should have pointed out that your code above is not equivalent to the original. Consider $status = "a string" for instance. The original would return zero because that "a string" == 0 is true. Yours would return 1 because "a string" is also true.

-sauoq
"My two cents aren't worth a dime.";

Replies are listed 'Best First'.
Re(3): variable set to 0 ? 0 : 1
by Arien (Pilgrim) on Sep 09, 2002 at 23:37 UTC
    Someone should have pointed out that your code above is not equivalent to the original.

    You are right. After explaining the exact meaning of the snippet, I just suggested a more sensible, although not exactly equivalent, way. :-)

    — Arien