PHP Magic function

Source: Internet
Author: User

In the world of PHP is full of magical colors, a lot of things you can not imagine, the following to introduce the Magic function.

Magic function:

__construct (): constructor is called when instantiating an object

__destuct (): Destructors are executed when an object is deleted or when an object operation terminates, and is used to free up free memory

__call (): Called when a method calling an object does not exist

__get (): Called when a property that does not exist for the object is called

__set (): Called when setting a property that does not exist for an object

__tosring (): Called when an object is printed

__clone (): Called when cloning an object

__isset (): Called when detecting whether an object has a property

__unset (): unset When an object is called


PHP Magic function

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.