Usage of php anonymous functions

Source: Internet
Author: User
: 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.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.