copies are faster if you don't change the copied data since no copy is actually done. It is a shallow copy also know as a copy-on-write so you should just pass a copy in your case, I bet.
-Rasmus On Mon, 14 Jan 2002, Tino Didriksen wrote: > Is it just me, or is working with references slow? > > I have functions that loop through about 10000 lines of text, generating > stats on the content. > > When I pass the lines to the function normally, this takes 0.8 seconds. > Passing by reference, or as a reference, both increase the time to 6 > seconds. > > Meaning that working with references takes 750% the time. > > In my head, making a copy should be slowest, but apparently referencing is > far slower... > Am I missing a point anywhere? > > --|-- > Tino Didriksen > http://ProjectJJ.dk/ > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]