Home > Backend Development > PHP Tutorial > PHP闭包的语法是什么

PHP闭包的语法是什么

PHPz
Release: 2020-09-04 17:24:28
Original
1501 people have browsed it

PHP闭包的语法是什么

PHP闭包的语法是什么?

php的闭包(Closure)也就是匿名函数。是PHP5.3引入的。

闭包的语法很简单,需要注意的关键字就只有use,use意思是连接闭包和外界变量。

$a =function()use($b) { 
}
Copy after login

更多相关技术文章,请访问PHP中文网

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template