PHP magic methods (introduction), php magic methods introduction. PHP magic method (introduction), php magic method introduction publicvoid_set (string $ name, mixed $ value) publicmixed_get (string $ name) publicbool_isset (string $ name) publicvoid_uns PHP magic method (introduction), php magic method introduction
Public void _ set (string $ name, mixed $ value)
Public mixed _ get (string $ name)
Public bool _ isset (string $ name)
Public void _ unset (string $ name)
Public mixed _ call (string $ name, array $ arguments)
The functions of these methods are as follows:
_ Set (string $ name, mixed $ value): this parameter is called when an object assigns values to undefined or invisible attributes. parameter name is the attribute to be assigned, value is the value to be assigned to the attribute.
_ Get (string $ name): it is called when an object is accessed with undefined or invisible attributes. the parameter name is the name of the attribute to be accessed.
_ Isset (string $ name): isset () is called when undefined or invisible attributes are used. the parameter name is the attribute name.
_ Unset (string $ name): the parameter name is called when unset () is used for undefined or invisible attributes.
_ Call (string $ name, array $ arguments): this parameter is called when an undefined or invisible method is called. the parameter name is the method name, the arguments parameter is an array composed of parameters to be passed to the method.
Note: The role of these pattern methods is to intercept operations on non-existent object members, and then respond to them accordingly. all these methods must be modified using public.
Introduction (introduction), php magic method introduction public void _ set (string $ name, mixed $ value) public mixed _ get (string $ name) public bool _ isset (string $ name) public void _ uns...