Home  >  Article  >  Backend Development  >  Basic concepts of object-oriented php

Basic concepts of object-oriented php

不言
不言Original
2018-06-06 09:38:271681browse

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.

对象中的:

    变量 ——>  属性

    函数 ——>  方法

Class && Object

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

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

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

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

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

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!

Statement:
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