title: How can I add a condition inside a php array?
body: <p>Here is the array</p>
  
  <pre><code>$anArray = array(
     "theFirstItem" =&gt; "a first item",
     if(True){
       "conditionalItem" =&gt; "it may appear base on the condition",
     }
     "theLastItem"  =&gt; "the last item"
  
  );
  </code></pre>
  
  <p>But I get the PHP Parse error, why I can add a condition inside the array, what's happen??:</p>
  
  <blockquote>
  <pre><code>PHP Parse error:  syntax error, unexpected T_IF, expecting ')'
  </code></pre>
  </blockquote>