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 Quote 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. Quote 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! Quote Link to comment https://forums.phpfreaks.com/topic/23671-solved-arraysreferences-a-quickie/#findComment-107450 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.