On 12/06/2022 19:21, Larry Garfield wrote:
On Thu, Jun 9, 2022, at 11:34 AM, Larry Garfield wrote:

A little data:

I used Nikita's project analyzer on the top 1000 projects to get a rough sense of how 
long-closures are used now.  All usual caveats apply about such survey data.  I was 
specifically looking at how many `use` statements a closure typically had, and how many 
statements it typically had.  Mainly, I am interested in how common "really long 
closures where the developer is likely to lose track of what is and isn't closed 
over" are.

Total closures: 20052
Total used variables: 11534

Did many of those closures use "pass by reference" in the use clause, because that's one real differentiator between traditional closures and short lambdas. There's also the fact that use values are bound at the point where the closure is defined, not where it's called (if they even exist at all at that point), although that's probably more difficult to determine.


--
Mark Baker

 _________
|.  \     \-3
|_J_/ PHP |
|| |  __  |
|| |m|  |m|

 I LOVE PHP

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to