I can't really see the issue, when trying your code I got the same error.
So I reset the code and write my own solution, and it works!
At the moment I can't see any difference between your code and my code. I suggest you copy my code and see if it works.
// Write the code to modify
// the $languages array!
$languages = "J2EE";
I found a difference, there is a space between "J2EE" and the semicolon coming after.
But this shouldn't be the problem.