PHP-Object Oriented

Source: Internet
Author: User

PHP-Access Control

Public Access property, without any access restrictions

Private Access property, accessible only within the class

Protected protected access properties that can be accessed only in this class or subclass or in a parent class

PHP-Magic Method

__construct () constructor: Used when object is initialized (called when new)

__destruct () destructor: Object destruction using (automatic invocation), meaning: When the object is destroyed, release other resources

__tostring () __tostring () automatically calls when the object is converted to a string

__invoke () __invoke () automatically calls the object when it is called as a method

__call () The __call () method is automatically called when an object accesses a method name that does not exist

Static __callstatic () when an object accesses a static method name that does not exist, the __callstatic () method is automatically called

__get () When reading the value of an inaccessible property, __get () is called

__set () __set () is called when a value is assigned to an unreachable property

__isset () when isset () or empty () is called on an inaccessible property, __isset () is called

__unset () __unset is called when unset () is called on a non-accessible property

PHP-Object Oriented

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.