[update] This isn't a duplicate question of "what's the difference between AND and &&" rather it's a question regarding the use of AND and the ternary operator. anyway i think i got my answer i didn't know that all operators have precedence which alex kindly pointed out. http://php.net/manual/en/language.operators.precedence.php
[original]
echo TRUE && TRUE ? 'A' : 'B';
// Outputs: A
echo TRUE AND TRUE ? 'A' : 'B';
// Outputs: 1
I know that the ternary operator syntax is
condition ? true : false
and the difference between && and AND is evaluation precedence (of the condition)
e.g. TRUE AND TRUE && TRUE is evaluated at (TRUE AND (TRUE && TRUE))
so shouldn't using both AND and && yield the same return? is this a PHP bug? (im using ver5.5.23)
or should i just accept the fact that if i used AND in the condition it actually becomes excluded from the condition
e.g. TRUE AND TRUE ? 'A' : 'B' => (TRUE AND (TRUE ? 'A' : 'B'))