: This article mainly introduces the usage of php anonymous functions. For more information about PHP tutorials, see. Usage of php anonymous functions:
Considering the memory, some functions that only need to be called once can be written in the form of anonymous functions, which can be cleared after use. it is as concise and efficient as the ghost post.
Features of an anonymous function: 1. the function is only used once without a name.
2. anonymous functions are usually assigned to a variable.
3. the call method is also called using variables.
4. you can delete it immediately after the call.
Result: hello!
Result: 10
Result: 13
This is the first blog article of this chicken. I will write an article every day to encourage myself to make progress ~~
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.
The above describes the usage of php anonymous functions, including some content, and hope to help those who are interested in PHP tutorials.