Flexible function parameters, how to do it with a good practise?
<pre><code>function query($query, $cacheType, $cacheDuration, $responseType)

$query = Query to be executed.
$cacheType = Memcached etc.
$cacheDuration = Duration of cache.
$responseType = MySQL response type. (e.g array, json etc)
</code></pre>

<ol>
<li><p>I don't want to use cache, but expect to be JSON. How can I pass those 2 parameters?</p></li>
<li><p>If I set cacheType to "Memcached", how can I ensure a $cacheDuration is set to a valid integer?</p></li>
<li><p>If I add a fifth parameter to query function (e.g $fifth), how can I add it without breaking the calls used in entire website? They still give 4 parameters, but query updated to be 5 parameters.</p></li>
</ol>

<p>I'm looking for "good practise" responses mostly, otherwise I know passing NULL values to params.</p>
