Jump to content

[SOLVED] arrays/references - a quickie


redbullmarky

Recommended Posts

Hi all
On PHP5 here - not sure if it makes a difference to the answer at all.

If a function/class method returns an array, is it best to pick it up by reference?

[code]
function myfunction()
{
   return $reallybigarray;
}

$thearray = myfunction();
[/code]

or

[code]
function myfunction()
{
   return $reallybigarray;
}

$thearray = &myfunction();
[/code]

cheers
Mark
Link to comment
https://forums.phpfreaks.com/topic/23671-solved-arraysreferences-a-quickie/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.