Php Value Object Mode (III)-PHP development

Source: Internet
Author: User
Unlike PHP5, PHP4 copies the object when assigning values to object resources. This syntax essentially matches the value object design pattern requirements. However, PHP4 does not control the visibility of attributes and method functions beyond the object. Therefore, the design pattern of implementing a value object is slightly different from that of PHP5. Unlike PHP5, PHP4 copies the object when assigning values to object resources. This syntax essentially matches the value object design pattern requirements.


However, PHP4 does not control the visibility of attributes and method functions beyond the object. Therefore, the design pattern of implementing a value object is slightly different from that of PHP5.


If you think back to the "object handle" section in the preface of this book, it proposes three "rules". When you use an object in PHP4 to imitate the object handle in PHP5, these three rules always apply:

1. Create an object using the pointer ($ obj = & new class.


2. Use the pointer (function funct (& $ obj) param {}) to pass the object.


3. Use a pointer (function & some

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.