Home > Backend Development > PHP Tutorial > Basic concepts of object-oriented php

Basic concepts of object-oriented php

不言
Release: 2023-03-29 21:56:01
Original
1774 people have browsed it

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

Object

Definition:

An object is a data structure in a program that is used to represent something.

Components:

contains variables and functions.

对象中的:

    变量 ——>  属性

    函数 ——>  方法
Copy after login

Class && Object

对象 --->  (归纳、总结)抽象    --->   类

类   --->  (具体化实现)实例化  --->   对象
Copy after login

Object-facing

Several major features: encapsulation, inheritance, polymorphism.

Encapsulation

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. .

Inheritance

refers to the relationship between classes, and subclasses inherit from parent classes.

Polymorphism

Different forms.

Object-oriented && Process-oriented

Difference

面向过程,把所有事物看作一整个运行过程

面向对象,把所有事物看作一个个对象交互运行
Copy after login

Relationship diagram

Basic concepts of object-oriented php

##Related recommendations :

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template