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 trialRoyner Lopez
Full Stack JavaScript Techdegree Student 3,830 PointsMy array on preview shows 4 items when only has 2, is that an error on your teamtrehouse code???
My array on preview shows 4 items when only has 2, is that an error on your teamtrehouse code???
<?php
class Render {
public static function displayDimensions($size){
return print_r($size);
}
}
$roomSize= array(
'length'=> 12,
'width'=> 14
);
Render::displayDimensions($roomSize);
?>
1 Answer
Steven Parker
231,186 PointsYou don't need to create an array in this challenge, the testing system does that part. What you're seeing is your array and the system's, where both have 2 elements.
You also don't need to print anything for task 2, it only wants you construct a string using the argument values and return it.