Having re-read www.php.net/functions.arguments recently, the notion of
passing arguments by reference to a function makes a lot more sense now.
However, my question is: is there any difference in outcome between:
function add_some_extra( &$string) {
$string .= 'and something extra.';
}
add_some_extra( $str);
and
function add_some_extra( $string) {
$string .= 'and something extra.';
return $string;
}
$str = add_some_extra( $str);
other than presumably that the former is less memory-intensive?
Martin
Comment