I just had to fix a problem where I did a comparison on a variable using OR in an ElseIf statement, and it would fail to match (expected) but still execute anyways. Here is a generic example:
Now, SyntaxCheckProd did not show any validation issues but in practice this code would fail in this condition. If $value matched Name3 or Name4 values, it would execute the "Name25" code even though it should have been skipped. Any times when Name1, Name2 or Name5 matched, then the code would execute properly. I have not tested where Name4 would match. I "fixed" this by putting "Name5" code into its own ElseIf statement, but it makes me wonder why this ended up happening.
And yes, I should probable switch over to using Switch/Case instead but I am just curious.
[ autoit ]
Now, SyntaxCheckProd did not show any validation issues but in practice this code would fail in this condition. If $value matched Name3 or Name4 values, it would execute the "Name25" code even though it should have been skipped. Any times when Name1, Name2 or Name5 matched, then the code would execute properly. I have not tested where Name4 would match. I "fixed" this by putting "Name5" code into its own ElseIf statement, but it makes me wonder why this ended up happening.
And yes, I should probable switch over to using Switch/Case instead but I am just curious.