Home >Backend Development >PHP Tutorial >Basic concepts of object-oriented php
This article mainly introduces the basic concepts of PHP object-oriented, which has certain reference value. Now I share it with everyone. Friends in need can refer to it
Object
An object is a data structure in a program that is used to represent something.
contains variables and functions.
对象中的: 变量 ——> 属性 函数 ——> 方法
对象 ---> (归纳、总结)抽象 ---> 类 类 ---> (具体化实现)实例化 ---> 对象
Object-facing
Several major features: encapsulation, inheritance, polymorphism.
Combine the properties and services of the object into an independent and identical unit, and hide the internal details of the object as much as possible, retaining only a limited external interface so that it can communicate with the outside. .
refers to the relationship between classes, and subclasses inherit from parent classes.
Different forms.
Object-oriented && Process-oriented
面向过程,把所有事物看作一整个运行过程 面向对象,把所有事物看作一个个对象交互运行
php object-oriented programming, php object-oriented
The above is the detailed content of Basic concepts of object-oriented php. For more information, please follow other related articles on the PHP Chinese website!