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

PHP闭包的语法是什么

PHPz
PHPzOriginal
2016-06-06 20:16:291462browse

PHP闭包的语法是什么

PHP闭包的语法是什么?

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

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

$a =function()use($b) { 
}

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

Statement:
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