Clone: Creating a new object by copying an existing one, rather than instantiating from a class definition. Cloning creates a new object by copying an existing one instead of building it from scratch. In PHP you use the clone keyword; in JavaScript structuredClone() or the spread syntax for simple objects. The important detail is shallow versus deep copying. A shallow clone copies the object itself, but nested objects are still shared. Change a nested address on the copy and the original changes too. A deep clone copies everything.
In PHP you control this with the __clone() method, where you clone nested objects explicitly. Cloning is useful for templates, such as a default configuration you adjust per use, and in tests. Immutable objects, which return a new copy whenever something changes, avoid most of these surprises and are often the cleaner design.
Implement proven backend architecture patterns including Clean Architecture, Hexagonal Architecture, and Domain-Driven Design. Use this skill when designing clean architecture for a new microservice, when refactoring a monolith to use bounded contexts, when implementing hexagonal or onion architecture patterns, or when debugging dependency cycles between application layers.