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 trialSoftware Singh
7,123 Pointsgot the solution but not able to pass this challenge
I have successfully returned the desired output but still, I am not passing this challenge
<?php
class Render {
public static function displayDimensions($size){
return $size['0'] . ' x ' . $size['1'];
}
}
$obj = new Render();
echo $obj->displayDimensions(array(12 , 14 ));
?>
1 Answer
Jennifer Nordell
Treehouse TeacherHi there! You are so close! I assume it's the second step of the challenge you're stuck on. The problem is that you're using the strings 0 and 1 for your indexes instead of the integers 0 and 1 for your indexes. This won't work. So this line:
return $size['0'] . ' x ' . $size['1'];
Should be:
return $size[0] . ' x ' . $size[1];
Hope this helps!
Software Singh
7,123 PointsSoftware Singh
7,123 Pointsthanks! that worked well....