Hi, I'm just wondering why this code produces (at least for me) incorrect results.
Okay, maybe it's my fault
$description = 'Paper: ' . ($paperType == 'bond') ? 'Bond' : 'Other';
I guess, if paperType is equal to "Bond", the description is "Paper: Bond", if paperType is not equal to "Bond", the description is "Paper: Other".
But when I run this code, the result is that the description is "Bond" or "Other" and leaves me Wondering where the string "Paper:" went? ? ?
Related to operator precedence. You must do the following:
Try adding parentheses so that the string is concatenated to another string in the correct order.