Home >Backend Development >PHP Tutorial >How to use __invoke()? Summary of __invoke() instance usage in php
tostring() magic method When an object is used as a string, this method will be automatically called, and in this method, a certain string can be returned to indicate the result of converting the object into a string. This magic method is relatively common. Note: If this method is not defined, the object cannot be used as a string! Example of undefined tostring() method in a class:
1. PHP object-oriented-detailed code examples of __tostring() and __invoke()
##Introduction: When the __tostring() magic method uses an object as a string, it will automatically call this method, and in this method, certain characters can be returned String to indicate the result of converting the object to a string. This magic method is relatively common. Note: If this method is not defined, the object cannot be used as a string! Example of undefined __tostring() method in a class:
Introduction: __construct(), __destruct(), __call(), __callStatic(), __get(), __set(), __isset(), __unset(), __sleep(), __wakeup(), __toString(), __invoke(), __set_state() and __
##3.Multiple PHP Functions Local Denial of Service&nbs_PHP tutorial
Introduction: Multiple PHP Functions Local Denial of Service&nbs. com_invoke() ?php // =========================================== ======================================= // // PHP 4.4.6 com_invoke() Local Denial of Service // // Tested on WIN XP,4. Introduction: The newly added _invoke method in php5.3 In php 5.3, a newly added invoke method was discovered. The example is as follows: ##5. Method
Introduction: Magic methods in php PHP magic methods: __construct(), __destruct(), __call(), __callStatic(), __get(), __set() , __isset(), __unset(), __sleep(), __wakeup(), __toString(), __invoke(), __set_state(), __
6. in PHP Magic methods
Introduction: Magic methods in PHP Commonly used magic methods are: __construct(), __destruct(), __call(), __callStatic(), __get(), __set(), __isset(), __unset(), __sleep(), __wakeup(), __toString(), __invoke(), __set_state(
7. php5.3 The newly added _invoke method
8. php Trick Method
##Introduction :php magic method __construct()__set()__get()__isset()__unset()__autoload()__call()__clone()__invoke()__sleep()__wakeup()__construct()Construction method: Constructor method requirements in PHP The constructor cannot be overloaded, that is, there is only one constructor.?functio 9. Multiple PHP Functions Local Denial of Service&nbs Introduction: Multiple PHP Functions Local Denial of Service&nbs. com_invoke() ?php // =========================================== ======================================= // // PHP 4.4.6 com_invoke() Local Denial of Service // // Tested on WIN XP, 【Related Q&A recommendations】:
The above is the detailed content of How to use __invoke()? Summary of __invoke() instance usage in php. For more information, please follow other related articles on the PHP Chinese website!