title: Using Ternary Function in Associative Array (PHP)
body: <p>I'd like to understand if it's a) possible and b) "side-effect free" to assign associative array elements using a ternary function in PHP.</p>
  
  <p>So instead of this:</p>
  
  <pre><code>$second_element = $test ? "tistrue" : "tisfalse";
  echo build_assignment_page(array(
    'firstkey'  =&gt; $first_element,
    'secondkey' =&gt; $second_element,
    'thirdkey'  =&gt; $third_element
   ));
  </code></pre>
  
  <p>Something like this:</p>
  
  <pre><code>echo build_assignment_page(array(
    'firstkey'  =&gt; $first_element,
    'secondkey' =&gt; ($test ? "tistrue" : "tisfalse"),
    'thirdkey'  =&gt; $third_element
   ));
  </code></pre>