This is kind of a ridiculous question...mostly to hopefully prove my old man programmer friend wrong.
I write if statements like this (ones with AND/OR in them), as I have always known...
if($something == $something OR $whatever == $whatever){stuff...}
My old man friend does this...
if(($something == $something) OR ($whatever == $whatever)){stuff...}
I have never seen anyone do it like that before. It does run without error. I told him that is invalid code but he shrugs it off and says it runs. Is it valid? I mean...it does run. Extra characters so mine still wins. Was this an old way of doing it in PHP? I can't find any info on the latter style. Just kind of curios. Thanks.
Both are valid ways, the second one, with the extra parentheses is more readable.
Why use an extra set of parenthesis when using PHP boolean test in an IF()?