String concatenation and/or ternary operator behaves weirdly wit $fwrite

In reply to xning:

What are you expecting to see?