Native DeepCloner vs. Manual Serialization: What You Need to Know
SMRTR summary
Symfony 8.1 introduces DeepCloner and ObjectMapper as modern alternatives to PHP's long-standing serialize/unserialize cloning hack. This guide benchmarks six deep-cloning strategies on circular-reference DDD object graphs, explaining how COW memory optimization is preserved and why the Serializer component should never be used for cloning. DeepCloner with its optional C-extension runs 4–5x faster than pure PHP.
SMRTR provides this summary for quick context. The original article belongs to Hacker Noon.
Read the original article