← All tasks
🌳
Programming Intermediate

Closures and the use() Keyword

⏱ 3 min ⭐ 70 XP 🔁 3 attempts allowed

What you'll do

Pick the correct explanation of variable capture in an anonymous function.

Scenario

$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