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 Object-Oriented PHP Basics Building the Recipe Static

Benjamin Intal
Benjamin Intal
1,805 Points

Add a return value to the displayDimensions method that returns these values as a string "length x width".

Add a return value to the displayDimensions method that returns these values as a string "length x width".

index.php
<?php

class Render {
    public static function displayDimensions($size) 
    {
      $size = array("length", "width");
      return self::displayDimensions($size );
    }
}

?>

1 Answer

Hi Benjamin,

I believe on this one you only need to return the string based off the elements in the array, I think the clue is that the array is an indexed array and not an associative array based on the fact they mention the order.

Something like this should work:

<?php
class Render {
    public static function displayDimensions($size) {
      return $size[0].' x '. $size[1];
    }
}

echo Render::displayDimensions($size);
?>

Hope that helps

KB :octopus: