Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP Object-Oriented PHP Basics (Retired) Inheritance, Interfaces, and Exceptions Final Challenge

Cassia Mancuso
Cassia Mancuso
7,843 Points

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);
}

}

1 Answer

Jeremy Canela
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Jeremy Canela
Full Stack JavaScript Techdegree Graduate 30,766 Points

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 :)

Cassia Mancuso
Cassia Mancuso
7,843 Points

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."

Cassia Mancuso
Cassia Mancuso
7,843 Points

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