DeepCopy helps you create deep copies (clones) of your objects. It is designed to handle cycles in the association graph. How do you create deep copies of your objects (i.e. copying also all the objects referenced in the properties)? You use __clone() and implement the behavior yourself. DeepCopy recursively traverses all the object's properties and clones them. To avoid cloning the same object twice it keeps a hash map of all instances and thus preserves the object graph. Alternatively, you can create your own DeepCopy instance to configure it differently. You may want to roll your own deep copy function. You can add filters to customize the copy process. DeepCopy\Matcher applies on a object attribute. DeepCopy\TypeMatcher applies on any element found in graph, including array elements. The PropertyNameMatcher will match a property by its name.

Features

  • Implement your own cloning method
  • Use a filter with a type matcher
  • Roll your own deep copy function
  • Add filters to customize the copy process
  • Provides some generic filters and matchers

Project Samples

Project Activity

See All Activity >

Categories

Object Oriented

License

MIT License

Follow DeepCopy

DeepCopy Web Site

Other Useful Business Software
Our Free Plans just got better! | Auth0 Icon
Our Free Plans just got better! | Auth0

With up to 25k MAUs and unlimited Okta connections, our Free Plan lets you focus on what you do best—building great apps.

You asked, we delivered! Auth0 is excited to expand our Free and Paid plans to include more options so you can focus on building, deploying, and scaling applications without having to worry about your security. Auth0 now, thank yourself later.
Try free now
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of DeepCopy!

Additional Project Details

Programming Language

PHP

Related Categories

PHP Object Oriented Software

Registered

2021-07-19