Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialUros Mitic
5,472 PointsNeed help with: "Add an element to the movie array with a key of "year" and a value of 1980."
Guys i need some help.I do not see how my code is wrong (maybe i'am missing something out) .But i get "Bummer! It looks like you don't have a "year" element in the $movie array." error. Here is my code:
<?php $movie = array(); $movie["title"] = "The Empire Strikes Back"; $movie["year"] = 1980; ?>
1 Answer
Gareth Borcherds
9,372 PointsSometimes the code verification engine is a little finicky. Try adding it all on separate lines.
<?php
$movie = array();
$movie["title"] = "The Empire Strikes Back";
$movie["year"] = 1980;
?>
Uros Mitic
5,472 PointsUros Mitic
5,472 PointsThanks for your reply.I have tried to do that but still no luck.I got the same error.
Gareth Borcherds
9,372 PointsGareth Borcherds
9,372 PointsHere is my complete code, maybe check against this to see if you are doing something different. I think it's just something the code verification engine is messing up as your code looks correct.
Uros Mitic
5,472 PointsUros Mitic
5,472 PointsI copied your part of the code and it worked.Still can't spot the difference.I think you are right about code verification engine.Thanks a lot for your time and effort, you saved me! Wish you all the best. :)