Home > Article > Backend Development > Benefits of php closures
What is a closure?
Functions that can read internal variables of other functions.
Benefits of closures:
1. Able to read the variables inside the function
2. Let these variables always exist in the memory. It will be recycled by the garbage collection mechanism after the call is completed
Recommended tutorial:PHP video tutorial
The above is the detailed content of Benefits of php closures. For more information, please follow other related articles on the PHP Chinese website!