PHP 7.4 introduced Arrow functions. And it also introduced implicit by-value scope binding which eliminate the need for use
keyword.
Now if we want to use a variable out of a closure's scope by reference with a regular anonymous function we would do this:
$num = 10;
call_user_func(function() use (&$num) {
$num += 5;
});
echo $num; // Output: 15
But using an arrow function it seems impossible
$num = 10;
call_user_func(fn() => $num += 5);
echo $num; // Output: 10
So how to use $num
variable by reference?