Pick the correct explanation of variable capture in an anonymous function.
$multiplier = 3; $fn = function($x) use ($multiplier) { return $x * $multiplier; }; then $multiplier is changed to 10 afterward.
Ready to try it?
Create a free account and try "Closures and the use() Keyword" free for 7 days, no card required. Earn 70 XP and track your internship progress.
Already have an account? Sign in