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 trialBenoit Tordeurs
Full Stack JavaScript Techdegree Student 9,400 Pointsobject 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
<?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
Treehouse TeacherHi 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!
Benoit Tordeurs
Full Stack JavaScript Techdegree Student 9,400 PointsCongratulation 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!