: This article mainly introduces the PHP magic method __clone _ toString. if you are interested in the PHP Tutorial, refer to it. In versions later than php5, classes can use magic methods. Php requires that all methods starting with two underscores
PHP magic method _ sleep _ wakeup (4) ,__ sleep _ wakeup. PHP magic method _ sleep _ wakeup (4), __sleep _ wakeup serialize can serialize variables including objects and convert them into continuous bytes data. you can save the serialized variable
PHP magic method _ get _ set (2) ,__ get _ set. PHP magic method _ get _ set (2) ,__ get _ set slowly finds the night, when bright moon hangs _ get ()-when reading the value of the inaccessible attribute, __get () will be called _ set ()-in the PHP
PHP magic. PHP magic method 1, _ get _ set: Take Over object properties 2, _ call _ callStatic: control the use of php object methods 3, _ toString: convert a php object to a string 4, _ invoke: PHP magic method
1. _ get/_ set: take over the object
Examples of functions and usage of common magic methods in PHP, and php magic. Common magic methods in PHP functions and usage examples. php magic overview in object-oriented programming, PHP provides a series of magic methods, these magic methods
This article describes a new function of php5, we introduce the use of PHP magic function __autoload and some problems, the following summarizes the use of the process of some problems and considerations.
__autoload () Usage
Some of the lectures in
This article mainly introduces the usage of the php magic function _ call (). The example analyzes the functions and usage skills of the _ call () function, which has some reference value, for more information about how to use the php magic function
PHP magic function _ call () usage. The so-called PHP magic function, simply put, has a specific name in PHP-it all starts with two underscores, in addition, the PHP interpreter will automatically search for the so-called PHP magic function when
The Magic constant PHP provides a lot of predefined constants to any script it runs, and our usual PHP magic constants are __class__ __function__ __line__ __file__ __dir__ __method__, This article introduces PHP Magic constants to you through
This article describes a new function of php5. we will introduce the usage and some problems of PHP magic function _ autoload, the following summarizes some problems and precautions during usage.
This article describes a new function of php5. we
PHP Magic Quotes brings security issues analysis, magic quotes
The "\" character generated by PHP by extracting magic quotes poses some security problem, such as the following snippet:
Foo.php?xigr= ' Ryatfunction daddslashes ($string, $force = 0) {
Magic Quotes is used to filter forms submitted over illegal information processing, if (GET_MAGIC_QUOTES_GPC ()) echo "Magic quotes is enabled"; else echo "Magic quotes is D Isabled ";
PHP-magic QuotesBefore to PHP 6th there is a feature called
Examples of magic methods in PHP and examples of php magic summary. Examples of magic methods in PHP are summarized and used. Examples of magic methods in php are special features of PHP object-oriented. They are triggered under specific
: This article mainly introduces the PHP magic method __construct _ destruct. if you are interested in the PHP Tutorial, refer to it. In versions later than php5, classes can use magic methods. Php requires that all methods starting with two
PHP magic Variable _ METHOD __,__ FUNCTION _, functionmethod
_ METHOD _ class METHOD name (New PHP 5.0.0 ). Returns the name (case sensitive) when the method is defined )._ FUNCTION name (New in PHP 4.3.0 ). Starting from PHP 5, this constant
This article mainly introduced the PHP magic function __call () usage, the example analysis __call () function and the use skill, has certain reference value, the need friend may refer to the next
This article analyzes the PHP magic function
PHP Magic Constants Detailed
Example:
Class moshu{public
function Moshu () {
echo ' current class name: '. __class__. "";
Echo ' Current method name: '. __function__. "";
Echo ' The number of rows in the current file: '. __line__. "";
Echo
PHP---Magic Method (__tostring (), __set_state ())Look at the following code:?
12345678
class Test{ public $a; public function func(){ echo ‘我只是一个字符串‘; }}$test = new Test();echo $test;
The output is:catchable
Summary of Magic Methods in PHP:__construct, __destruct, __call, __callstatic,__get, __set, __isset,__unset, __sleep, __wakeup, __tostring, __set_state, __clone and __autoload1, __get, __setThese two methods are designed for properties that are not
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.