<?php/* class declaration * 1. What do you want to develop, determine what class to write * 2. The members of the class must belong to this class * [modifier class's Keywords] class class name {* member Property: * Member Method: *} * 3. When declaring a member property in a class, a modifier must precede the Not sure which word to use, use VAR or public * A file holds only one class, the file name contains the class name, the file: class name. class.php * Class Name: * Variable: AAABBBCCC * Function: AAABBBCCC * Constant: AAABBBCCC * class Name: Aa ABBBCCC * 4. member properties in the class, if you create multiple objects, each object has a different property value, do not give the initial value directly, after creating the object and then give the values * * * through the class to instantiate the object * 1. Use new to create a new object, plus the class name, which is the object that created the class * $ object reference =new class name; * 2. As long as there is a new keyword is to create an object, create an object is to allocate a space in memory * * Only objects are stored within the storage space * * Object in memory allocation * * object's use * The members of the object must access the object by reference to the * object , member, member property, member Properties * Object---Members Method * * * * *//class declaration (Phone Class) class phone{//Declaration attribute Var $pinPai var $color var $batteryCapaci Ty var $screenSize; Member method function call () {} function message () {} function Playmusic () {} function photo () {}}//Class instantiation class person{var $n Ame var $age; var $sex; function say () {} function Eat () {} function run () {}}//instantiation $p 1=new person; $p 2=new person; $p 3=new person; Access the members of the object $p 1->name= "Zhangsan"; echo $p 1->name;?>