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): Called when an object assigns a value to an undefined or invisible property, the parameter name is a property that needs to be assigned, and value is the values that need to be assigned to the property.
_get (String $name): Called when an object accesses an undefined or invisible property, the parameter name is the name of the property that needs to be accessed.
_isset (String $name): Called When using Isset () for an undefined or invisible property, the parameter name is the property name.
_unset (String $name): Called When using unset () for an undefined or invisible property, the parameter name is the property name.
_call (string $name, array $arguments): Called when an object calls an undefined or invisible method, the parameter name is the method name, and the parameter arguments is an array of arguments to pass to the method.
Note: The purpose of these pattern methods is to intercept operations that access non-existent object members and then respond accordingly, and these methods must be decorated with public.
http://www.bkjia.com/PHPjc/993266.html www.bkjia.com true http://www.bkjia.com/PHPjc/993266.html techarticle 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 _uns ...