NYCPHP Meetup

NYPHP.org

[nycphp-talk] newbie confusion

Mitch Pirtle mitch.pirtle at gmail.com
Thu Nov 11 09:21:40 EST 2004


On Thu, 11 Nov 2004 08:41:49 -0500, Aaron Fischer
<agfische at email.smith.edu> wrote:
> I'm curious to know what the "&" is for in the statement below?
> 
> On Nov 10, 2004, at 11:30 PM, Christopher Hendry wrote:
> 
> > function add_new_interviewer( &$interveiwer_info ) {
> 

That is known as passing by reference.  When you omit the '&', you are
actually making a copy of it instead of passing it directly to that
function or method.

This can be a problem with larger apps under heavy load, where you
accidentally have the webserver making copies of many arrays and
objects.

This behavior is changed by default in PHP5, and there are others on
this list that are much more knowledgable on PHP5 than I.  I'm still
trying to get Fedora Core 3 to install ;-)

-- Mitch, burning another set of CDs



More information about the talk mailing list