If a function creates then returns an array, is the original array itself returned or is a copy of it returned?
Example:
function db_query($sql)
{
$set = mysql_query($sql);
return $set;
}
$records = db_query('Select * from table');
Does the code actually end up making a copy of $set?
Would it save some memory usage if references were explicitly used?
Example:
function &db_query($sql)
{
$set = mysql_query($sql);
return $set;
}
$records = &db_query($sql);