You are here: Re: Pass by reference via 'return' a variable... « PHP Programming Language « IT news, forums, messages
Re: Pass by reference via 'return' a variable...

Posted by Benjamin on 10/13/06 02:11

You have to pass a reference.
TeejB wrote:
> I guess the question is: will PHP optimize this for me so that the
> entire contents aren't copied out of the function, or do I have to pass
> in a reference?
>
>
> Benjamin wrote:
> > Passing reference is preferred because passing an array back is seen as
> > more of a 'hack'
> > TeejB wrote:
> > > Hi all,
> > >
> > > Quick question: If I have a function which populates a large array (ie.
> > > reading rowsets), is it better to pass in a reference to a variable to
> > > accept the data, or should I just create, populate and return the array
> > > from the function?
> > >
> > > Thanks in advance!

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация