redbullmarky Posted October 11, 2006 Share Posted October 11, 2006 Hi allOn 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]cheersMark Link to comment https://forums.phpfreaks.com/topic/23671-solved-arraysreferences-a-quickie/ Share on other sites More sharing options...
effigy Posted October 11, 2006 Share Posted October 11, 2006 I think references are always the way to go when passing around arrays, whether it's PHP, Perl, etc. Otherwise, the array has to be copied. Link to comment https://forums.phpfreaks.com/topic/23671-solved-arraysreferences-a-quickie/#findComment-107446 Share on other sites More sharing options...
redbullmarky Posted October 11, 2006 Author Share Posted October 11, 2006 ok cool, thanks! Link to comment https://forums.phpfreaks.com/topic/23671-solved-arraysreferences-a-quickie/#findComment-107450 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.