Workarounds for PHP's array_reduce integer third parameter
<p>For <a href="http://bugs.php.net/bug.php?id=45700" rel="nofollow">some</a> or <a href="http://bugs.php.net/bug.php?id=42566" rel="nofollow">other</a> reason, the <a href="http://us2.php.net/manual/en/function.array-reduce.php" rel="nofollow"><code>array_reduce</code></a> function in PHP only accepts integers as it's third parameter. This third parameter is used as a starting point in the whole reduction process:</p>

<pre><code>function int_reduc($return, $extra) {
    return $return + $extra;
}

$arr = array(10, 20, 30, 40);
echo array_reduce($arr, 'int_reduc', 0); //Will output 100, which is 0 + 10 + 20 + 30 + 40

function str_reduc($return, $extra) {
    return $return .= ', ' . $extra;
}

$arr = array('Two', 'Three', 'Four');
echo array_reduce($arr, 'str_reduc', 'One'); //Will output 0, Two, Three, Four
</code></pre>

<p>In the second call, the <code>'One'</code> gets converted to it's integer value, which is 0, and then used.</p>

<p><strong>Why does PHP do this!?</strong></p>

<p>Any workarounds welcome...</p>
