Skip to content
This repository was archived by the owner on Sep 9, 2019. It is now read-only.

Conversation

@thekid
Copy link
Contributor

@thekid thekid commented Sep 20, 2015

The following code previously yielded the first command line argument due to the implicit capturing of local variables. This made it incompatible with PHP.

class Test {

  public static function main($args) {
    $f= function() { return $args[0]; };
    \util\cmd\Console::writeLine($f());
  }
}

We now need to add a use($args) in order for this to work.

This PR doesn't affect XP language where implicit binding is the default.

@thekid thekid added the bug label Sep 20, 2015
thekid added a commit that referenced this pull request Sep 20, 2015
Make capturing explicit when using the PHP lambda form
@thekid thekid merged commit 9380233 into master Sep 20, 2015
@thekid thekid deleted the fix/lambda-uses-explicit branch September 20, 2015 14:47
@thekid thekid added the php label Sep 20, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants