Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP PHP Basics (Retired) PHP Datatypes PHP Datatypes Challenge

Dave Lowther
Dave Lowther
Courses Plus Student 20,797 Points

Can't pass PHP challange to echo 2nd value from array.

I've tried changing the number in my echo command, rotated through 0, 1, 2 to no effect.


//Place your code below this comment
  $integer_one = 1;
  $integer_two = 2;

  $golden = 1.618;

  $bool = true;

  $colors = array("red", "blue", "green");

  echo $colors[1];


2 Answers

Alex Heil
Alex Heil
53,534 Points

hey David Lowther , actually you're code is absolutely fine ;) however you have a var_dump statement in your code that wasn't asked for in the challenges and that's somehow confusing the checker. if you take that line out (I just re-tested it in the challenge) your code will pass just fine.

hope that helps and have a nice day ;)

Alex Heil
Alex Heil
53,534 Points

you're welcome david, great to hear this helped you out ;)