Hi Alexandru,
I don't think there is intention to do that. In particular with pass by
reference. Importing variables by-ref likely will be explicit, given recent
discussions on the matter.
The new Closures or the old ones might automatically "copy" all variables
(by-value) at some point, but I doubt they will ever "inherit" variables
automatically (by-reference).
Hence the proposed syntax or some other one will be needed for that. e.g.:

```
$foo = 123;

$fn1 = fn() => {
    echo $foo; // auto import by value
};

$fn2 = fn() => {
    use &$foo; // import by ref
    echo $foo;
};

$foo = 456;

$fn1(); // 123

$fn2(); // 456
```

Reply via email to