Cloning objects in both PHP4 and PHP5
Sometimes it is need to clone objects in PHP4 but PHP4 does not have method clone. Algis Alekna on his blog posted very simple solution for this situation.
Developing PHP applications that should work smooth on any PHP engine version or configuration, I need to invent some code tricks sometimes. One of the common things for me is to get a copy of an object. With PHP4 by default things are passed by value, alhough in PHP5 this behaviour has been changed and by default variables (objects) are passed by reference.