You can effectively ignore the fact $result is passed into the callback by reference. Only the return value of the callback is accounted for.
<?php
$arr = [1,2,3,4];
var_dump(array_reduce(
$arr,
function(&$res, $a) { $res += $a; },
0
));
# NULL
?>
<?php
$arr = [1,2,3,4];
var_dump(array_reduce(
$arr,
function($res, $a) { return $res + $a; },
0
));
# int(10)
?>
Be warned, though, that you *can* accidentally change $res if it's not a simple scalar value, so despite the examples I'd recommend not writing to it at all.