shadedecho
Programmer
OK, my question is two fold:
1. Is there a way to force PHP to disable its normal "short-circuit" evaluation of logical conditionals (ie, x1 || x2 || x3 stops evaluating immediately if it finds a "true"
? Can this disabling be done inline (for a particular script or even for a particular part of a script, so as to not affect the performance of other parts, while still giving me the more necessary behavior in a specific spot) instead of globally across the whole distribution?
2. If there is not a way to force PHP to behave differently, then what I need is to find the logical equivalent of || using only "xor" and "!". Why, you ask? because I need the BEHAVIOR of "||" but without the "short-circut", and "xor" and "!" by definition are NOT "short-circuit", meaning they both HAVE TO evaluate the expression to the right of them, no matter what.
the logical table would be:
any thoughts?
1. Is there a way to force PHP to disable its normal "short-circuit" evaluation of logical conditionals (ie, x1 || x2 || x3 stops evaluating immediately if it finds a "true"
2. If there is not a way to force PHP to behave differently, then what I need is to find the logical equivalent of || using only "xor" and "!". Why, you ask? because I need the BEHAVIOR of "||" but without the "short-circut", and "xor" and "!" by definition are NOT "short-circuit", meaning they both HAVE TO evaluate the expression to the right of them, no matter what.
the logical table would be:
Code:
a b | a || b | a ^ b | ????? |
___ ___ | ________ | _______ | _______ |
0 0 | 0 | 0 | 0 |
0 1 | 1 | 1 | 1 |
1 0 | 1 | 1 | 1 |
1 1 | 1 | 0 | 1 |
any thoughts?