Object oriented
First, Class and object:
Concept of the "1" object: Anything can be called an object, and the class is instantiated. (We are able to see everything that can be called objects)
"2" class concept: for all the same class of objects, we abstract out of things. For example: Our class, all students, have a common thing, our class number is the same, we learn the same course, we have the same time in class, then these same things we can take out alone, make a class, this class is a class of classes, for example, we people, Everyone has a common thing, a person, there are two eyes, a nose, a mouth, two ears, two arms, two legs, these are common human things, everyone has, if not the words are incomplete, we take these things out, he can also be called a class, this class is human, As long as you meet human standards, they are called human beings. (The abstraction of something similar is a class.) )
Second, define the class:
defining a class requires just a keyword class followed by a custom category name, plus a curly brace. The first letter of the class name should be capitalized. A class consists of two things: a member variable or a member property, a member method, or a member function.
Example:
Class Ren
{
Member variables
Member Methods
}
Iii. making objects (instantiating objects)
Use the new keyword only and add a method followed by the same name as the class name. of course, if you do not need to pass arguments to an object when instantiating it, you can use the class name directly after the new keyword, and you do not need to add parentheses.
The name of the $ variable name =new class ([parameter list]);//Object Instantiation format
Or
$ variable name =new class name;//object instance formatting, no arguments are required for the object
Example:
$r =new Ren ();
Iv. calling members in an object
$ reference Name, member property = value
PHP-------Object-oriented