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