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 trial

PHP PHP Basics (Retired) PHP Datatypes PHP Datatypes Challenge

How do you dump the memory ?

I'm receiving a false result from this link at the point of Echoing the Second Value of an array $colors. A number of helpful people have said the code is correct and one suggested that I clear the memory. I'm not sure how to do that within the interface. I even changed browsers.

<?php

 //Place your code below this comment
 $integer_one = 1;
 $integer_two = 2;
 $golden = 1.618;
 $bool = TRUE;
 var_dump ($bool);

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

 echo $colors [1];

 ?>

http://teamtreehouse.com/library/php-basics/php-datatypes/php-datatypes-challenge

3 Answers

Tim Knight
Tim Knight
28,888 Points

Sherry,

Perhaps it's just an issue with spacing that is freaking out the quiz. I went through it and used similar answers to yours and made it through successfully to the final question... here's how I wrote your answers:

<?php

//Place your code below this comment
$integer_one = 1;
$integer_two = 2;
$golden = 1.618;
$bool = true;

$colors = [];
$colors = ['red', 'blue', 'green'];

echo $colors[1];
?>

That's what happened. Thank you so much. It worked after I took out the space. Now I know :)

Kevin Korte
Kevin Korte
28,149 Points

What exactly is the result you're getting? And have you tried restarting your php server?

EDIT* I see you got it, awesome!