- Are closures possible in PHP 5.3?
- I'm looking for a simple closure example, minimal code is appreciated.
- If closures are possible in PHP 5.3, does it behave similarly to Javascript's closures in terms of scoping?
- What are the difference between Javascript closures and PHP closures (if it exists)?
关于PHP和闭包[关闭]
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
1条回答 默认 最新
- doujue6196 2011-07-13 13:11关注
- Are closures possible in PHP 5.3?
Yes
- I'm looking for a simple closure example, minimal code is appreciated.
$text = "Hello World"; $closure = function () use ($text) { echo $text; } $closure();
- If closures are possible in PHP 5.3, does it behave similarly to Javascript's closures in terms of scoping?
- What are the difference between Javascript closures and PHP closures (if it exists)?
Don't know. I never had a deeper look at JSs closures, but maybe you get an idea of whats PHPs closures are like after reading Wikipedia: Closure (Computer Science)
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报