Re: return by Reference?
| From: | Andreas Korthaus | Date: | Thu, 07 Oct 2004 13:12:35 +0000 |
| Subject: | Re: return by Reference? | ||
| References: | 1 2 3 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-14793@lists.php.net to get a copy of this message | ||
Hi!
Another question, what I tried before was not 100% correct, it works this
way:
function &remove_null (&$array) {
foreach ($array as $key=>$val) {
if (is_null($val)) {
$array[$key]='';
}
}
return $array;
}
$db->autoExecute(
'table',
remove_null($data),
DB_AUTOQUERY_INSERT
);
But what I don't know - does autoExecute() use a reference, or a copy of
$data?
I have no idea how to test it in this situation ;-)
I knwo that it should work with $var =&..., this is also simple to check.
regards
Andreas