Skip to content

Conversation

@AndreiDreyer
Copy link
Contributor

Added capturing for variables used in arrow closure expressions. Variables used in arrow closures that are not parameters passed to the arrow closure automatically capture the value of the variable outside the arrow closure

$foo = "foo";
fn () => $foo; // This captures the value of $foo outside the scope of the arrow closure

@AndreiDreyer AndreiDreyer requested a review from ml86 July 8, 2025 13:13
@TNSelahle TNSelahle force-pushed the andrei/php-automatic-variable-capturing-in-lambda branch from f30736d to 2249e94 Compare October 27, 2025 10:57
@TNSelahle
Copy link
Member

@ml86 please re-review. I've updated the branch and also successfully run integration and sptests for php2cpg -> https://buildbot.global.sltr.io/#/builders/82/builds/253

@TNSelahle TNSelahle force-pushed the andrei/php-automatic-variable-capturing-in-lambda branch from 2249e94 to 3c857a3 Compare October 29, 2025 10:51
@TNSelahle TNSelahle requested a review from ml86 October 29, 2025 12:36
@TNSelahle TNSelahle merged commit 7a79301 into master Oct 31, 2025
8 checks passed
@TNSelahle TNSelahle deleted the andrei/php-automatic-variable-capturing-in-lambda branch October 31, 2025 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants