Saving Yourself Time with the Clone Construct

Tutorials Shared by the Internet Community

Advertisements


Saving Yourself Time with the Clone Construct

Cloning an object is quite different than it was in PHP4.

Statistics

  • Total Hits - 31960

  • Total Votes - 98 votes

  • Vote Up - 42 votes

  • Vote Down - 56 votes

  • Domain - www.talkphp.com

  • Category - PHP/Object Oriented

  • Submitted By - Devesh Khanna

  • Submitted on - 2008-03-16 07:48:08

Description

Cloning an object is quite different than it was in PHP4. In PHP4 you simply assigned the object to a new object and it would clone it verbatim. With the release of PHP5, things got a little more complex but a lot more flexible. PHP5 offers the clone construct along with a magic method to control the cloning process.    More detail...


Broken  |   Tweet  |   Facebook  |     |   Save  |   Liked  |   Down

Advertisements