title: Which coding style you use for ternary operator?
body: <p>I keep it in single line, if it's short. Lately I've been using this style for longer or nested ternary operator expressions. A contrived example:</p>
  
  <pre><code>$value = ( $a == $b ) 
              ? 'true value # 1'
              : ( $a == $c )
                  ? 'true value # 2'
                  : 'false value';
  </code></pre>
  
  <p>Personally which style you use, or find most readable?</p>
  
  <p><strong>Edit:</strong> <em>(on when to use ternary-operator)</em></p>
  
  <p>I usually avoid using more than 2 levels deep ternary operator. I tend prefer 2 levels deep ternary operator over 2 level if-else, when I'm echoing variables in PHP template scripts.</p>