Assign parameters to function according to parameter names
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/4029404/php-optional-parameters-specify-parameter-value-by-name">PHP Optional Parameters - specify parameter value by name?</a>  </p>
</blockquote>



<p>I have an assoc array with a list of what are parameters to me. Here's an example:</p>

<pre><code>array(
    'param1' =&gt; 'value1',
    'param4' =&gt; 'value4',
    'param3' =&gt; 'value3',
    'param2' =&gt; 'value2',
);
</code></pre>

<p>Note that they may come unsorted. Now, is there a way I can make a call (static or from an instance, using <code>call_user_func_array</code> or similar) and correctly pass each value to each parameter? Just to be sure, an example function I'd like to call using that parameter array is one such this:</p>

<pre><code>exampleFunction($param1, $param2, $param3, $param4) {
    ...
}
</code></pre>

<p>PS: Reflection is great, but I'm concerned about execution times (which, at least, in Java tends to increase a lot when using Reflection). If you know any other way to do so, it would be awesome.</p>
