← All tasks
🔍
Programming Intermediate

Fix a Function Expecting Array Mutation by Value

⏱ 5 min ⭐ 120 XP 🔁 3 attempts allowed

What you'll do

Find the line where a function is expected to mutate the caller's array but can't, because PHP arrays are passed by value.

Scenario

Calling addItem($cart, 'apple') doesn't actually add anything to the caller's $cart array afterward.

Ready to try it?

Create a free account and try "Fix a Function Expecting Array Mutation by Value" free for 7 days, no card required. Earn 120 XP and track your internship progress.

Already have an account? Sign in