How to use the _ _ clone in php
This article mainly introduces the relevant knowledge of "how to use _ _ clone in php". The editor shows you the operation process through an actual case. The operation method is simple, fast and practical. I hope this article "how to use _ _ clone in php" can help you solve the problem.
Description
1. Used for object replication. Object replication is done through the clone keyword.
2. The _ _ clone () method does not require any parameters.
3. When copying, some properties of the target object are different from those of the source object, so you can define a _ _ clone () method in the class.
In this method, you finish assigning a new value to the properties of the target object.
Example