A conditional element inside an array(...) construct
<p>My system sends a configuration array to a function like this:</p>

<pre><code>callThatFunction( array(k1 =&gt; v1,  k2 =&gt; v2, ... kn=vn));
</code></pre>

<p>I want to make one of the key value pairs, conditional upon some circumstances.</p>

<p>Can I do this without creating a variable for the array (and this breaking the clean config syntax that someone else had created)?</p>

<p>Like this</p>

<pre><code>callThatFunction ( array(
k1 =&gt; v1, 
if($cond( {k2 =&gt; v2,} 
... 
kn=vn));
</code></pre>

<p>The above is obviously wrong syntactically, but should express my idea.</p>

<p>Thank you</p>
