SoFunction
Updated on 2025-04-11

PHP learning notes PHP object-oriented programming


<?php
/* PHP object-oriented programming
*
* PHP5
*
* Arrays and objects: Both belong to PHP compound types (one variable can store multiple units)
*
* Objects are more powerful than arrays. They can not only store multiple data, but also store functions in objects.
*
* Three major characteristics of an object: encapsulation, inheritance, and polymorphism
*
* Object-oriented programming (oop) //Complied with reusability, flexibility, scalability in software engineering
*
* Difference between object-oriented and process-oriented
*
* Minimum unit: function //Process oriented
* Minimum unit: object //Object-oriented
*
* What is an object
Recently, Sina's management has begun to cash out. Public information has disclosed that the MBO made the management proudly become Sina's largest shareholder, but to this day, they have become the second largest shareholder. The equity ratio is not much different: the ratio of 9.24% to the largest shareholder FMR is only 0.1%. However, Sina's management has an agreement to sell equity. If this part of the equity that may be sold in the future is included, the management will only have 5.74%. Sina is indeed likely to become a "ownerless company" again.
This is the future trouble for Sina as a company: the profit model is unclear, and the possibility of unparalleled begins to show up again.
* The object is an entity
*Object:
* Member attribute == variable //Define the appearance and state of the object
* Member method == function // define the function of the object
*
* What is a class
* Category, type, custom type
*
* Define properties and methods of this type in a class
*
* A relationship between a class and an object
*
* Declare the class --> Instantiate the object (create the object) --> Use the object
*
*
* The most rare thing is how to design object-oriented programs rather than object-oriented syntax.
*
*/
?>