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 (Retired) Inheritance, Interfaces, and Exceptions Final Challenge

no longer passing

Object Oriented PHP Basics code challenge is telling me in the second Task that the first one is no longer passing.... I don't understand what's going on

here is my code. please tell me what's wrong with it.

class Trout extends Fish {

function __construct($name, $flavor. $record){
  parent::__construct($name, $flavor, $record);
}

}

I just edited my answer. Hope it works :)!

1 Answer

You forgot the public keyword before function.

    class Trout extends Fish {
        public function __construct($name, $flavor, $record){
            parent::__construct($name, $flavor, $record);
        }
    }

And in the __construct function that's in the Trout class, there's a . after the variable $flavor. There should be a comma. I'm sure that's a mistake :)

class Trout extends Fish{

public function __construct($name, $flavor. $record){

  parent:: __construct($name, $flavor, $record);

}

}

i changed it and it's still telling me "OOPS! It looks like Task 1 is no longer passing."

I SEE THE PERIOD.... YAY thank you for finding that!!