> $foo = fn() => [$a, compact('a', 'b')]; > is essentially compiled to: > $foo = function (use $a) { return [$a, compact('a', 'b')] };
Regarding this, in case you're literally saying that internally "fn()" turns into a common "function", and getting back to the main topic, would it be possible to do the same with compact()? fn() => compact('dummy') turns into: fn() => [ 'dummy' => $dummy ] which turns into: function() use($dummy) { return [ 'dummy' => $dummy ]; } Atenciosamente, David Rodrigues