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 Building the Recipe Controlling the Class

object oriented php challenge page 3 1/1 always 3th step bumper Number 1 do not pass no more "CREATE FISH OBJECT NAMED

class Fish { public $common_name; public $flavor; public $record_weight;

function __construct($name, $flavor, $record){ $this->common_name = $name; $this->flavor = $flavor; $this->record_weight = $record; }

}

?> EVERYTIME I DO THE LAST STEP/ STEP 1 DOES NOT PASSED NO MORE

fish.php
<?php
class Fish {
  public $common_name;
  public $flavor;
  public $record_weight;


  function __construct($name, $flavor, $record){
    $this->common_name = $name;
    $this->flavor = $flavor;
    $this->record_weight = $record;
  }

}

?>

?>

2 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there, Benoit! To be perfectly honest, I'm not sure why you're getting the "Task 1 is no longer passing". That being said, you've removed things that were originally there. The class starts off with a getInfo() method which is now completely missing from your code. Your constructor seems correct, and I can find no problems there.

So, you've set up your constructor for the class, but step 3 is asking you to make an instance of the class and assign it to the variable $bass. The challenge supplies you with the strings you're supposed to send in. The creation of this instance should happen outside the class definition.

$bass = new Fish("Largemouth Bass", "Excellent", "22 pounds 5 ounces");

Also, you have an extraneous ?> which is not needed and may safely be removed.

Hope this helps! :sparkles:

Congratulation Jennifer, I just can't Believe it, it was so impossible for me, Impressive Lady, Millions of thanks, Ik can go ahead you made my day!