ID: 49019 User updated by: michaeldnelson dot mdn at gmail dot com Reported By: michaeldnelson dot mdn at gmail dot com -Status: Feedback +Status: Open Bug Type: Scripting Engine problem Operating System: freebsd PHP Version: 5.2.10 New Comment:
Thank you for the prompt response at the risk of proving myself more obtuse: I am aware of how = and || are associated it would appear to me that if || is associated on the left and it is associated before any = then (!$test = false || !$test2 = false) should evaluate to true because the left portion of this is just (!$test = false) which evaluates to true, also (!$test = false || false) evaluates to true if you meant that the false immediately to the left was causing this result this case proves otherwise. It still appears to me that ($!test = false || $!test2 = false) evaluates to false because the leftmost = operator is getting evaluated before the ||. I apologize for taking more of your time but your terse response didn't assuage my doubts on this particular issue, perhaps if you elaborated. Thanks again. Previous Comments: ------------------------------------------------------------------------ [2009-07-22 20:15:52] j...@php.net = is associated on right, || is associated on left, so that's exactly what your code does.. ------------------------------------------------------------------------ [2009-07-22 17:10:36] michaeldnelson dot mdn at gmail dot com Description: ------------ It appears = has a higher precedence than || in some situations which is contrary to the manual. This exception is not noted as far as I can tell. var_dump(!$test = false || !$test2 = false); is being interpreted like this var_dump(!$test = (false || !$test2 = false)); instead of like this var_dump((!$test = false) || (!$test2 = false)); If I missed something my apologies. Thanks, Michael D. Nelson Reproduce code: --------------- --- >From manual page: language.operators.precedence --- var_dump(!$test = false || !$test2 = false); echo "TEST\n"; var_dump($test); echo "TEST2\n"; var_dump($test2); Expected result: ---------------- bool(true) TEST bool(false) TEST2 NULL Actual result: -------------- bool(false) TEST bool(true) TEST2 bool(false) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=49019&edit=1