Some of their own understanding of magic methods:
1, the PHP object in certain operations, the specific magic method will be called. Called __construct () when constructing an object.
2, in object-oriented programming, __call () will have a relatively large use. Explanation for __call (): __call () is called when an inaccessible method is called in an object. In some frameworks, routing information and object methods, such as the CI framework, are linked by __call ().
3, about the use of __clone (): When the copy is complete, if the __clone () method is defined, then the __clone () method in the newly created object (copy generated object) is called and can be used to modify the value of the property, if necessary.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service