[development] passing data is free

Larry Garfield larry at garfieldtech.com
Tue Oct 9 02:33:41 UTC 2007


On Monday 08 October 2007, Sean Robertson wrote:
> > Why not? Passing data around is basically free. You are not copying
> > the data, you are creating a reference, deep copy only happens if you
> > modify the passed in argument (PHP5 only deep copies an object if you
> > instruct it with clone()). So do not hesitate to pass around as many
> > data as you want.
>
> How much difference is there in this between PHP4 and PHP5?

This much:
http://www.php.net/manual/en/migration5.php

The change in the way objects are passed is the only BC break that is not 
trivial to handle if you take care to do so, and Drupal has taken very good 
care to do so.

-- 
Larry Garfield			AIM: LOLG42
larry at garfieldtech.com		ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson


More information about the development mailing list