You are here: Re: PHP4/5 deep copy? « PHP Programming Language « IT news, forums, messages
Re: PHP4/5 deep copy?

Posted by Wayne on 08/29/05 21:50

On Sat, 27 Aug 2005 12:51:45 -0400, "Kevin" <kevin@wxREMOVE4SPAM3.com>
wrote:

>Can anyone suggest a more efficient way to copy an object that doesn't
>involve writing clone methods for all it's various subclasses and component
>classes?

Because you're looking for both PHP4 and PHP5 compatibility, I assume
that all your object members are public. If so, put a __clone()
method in the base class and and get_class_vars($this) to get all the
public variables of the subclass and use that to clone each property
that contains an object.

 

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

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