Reply to RE: [PHP] Re: gloabl & reference behavior question?

Your name:

Reply:


Posted by "Ford, Mike" on 10/21/46 11:22

On 22 July 2005 19:47, Surendra Singhi wrote:

> I don't think it will make the code confusing, but the person looking
> at the code should understand how reference and global variables
> work. Using reference variables avoids unnecessary extra copying of
> objects, and while
> using large arrays it can make a big difference in speed.

You shouldn't need to worry about this -- PHP tries to take care of it for
you. When you copy an array value, PHP only does a "shallow" copy (of the
array's address); if you later modify the array, this triggers a full "deep"
copy of all the array's element values before the modification is done.

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS, LS6 3QS, United Kingdom
Email: m.ford@leedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211


To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm

[Back to original 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

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