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 trialShaun Gehrke
742 PointsYour quizes donot follow the videos
Lame
<?php
class Fish {
public $common_name;
public $flavor;
public $record_weight;
function __construct(){
$this->$name = $common_name;
$flavor;
$record;
}
}
?>
2 Answers
peyton caseria
Courses Plus Student 12,281 PointsThey do this so you have to do more than just follow along, If you are wanting to get into this field professionally. It's a great exercise. Although I do wish they elaborated this a little more!
Shaun Gehrke
742 PointsDefine a constructor method on the Fish class with 3 parameters, in order, named $name, $flavor, and $record.
<?php
class Fish { public $common_name; public $flavor ; public $record_weight; } function __construct($name, $flavor, $record){ } ?>
I guess what I meant to say is that they should have better hints. ( Bummer! Did you create a constructor (__construct)? )
martinpatino2
4,741 PointsHere is the answer if you want it :
<?php
class Fish { public $common_name = ""; public $flavor = ""; public $record_weight = "";
function __construct($name, $flavor, $record) {
}
}
?>
martinpatino2
4,741 PointsI recommend googling questions and using stackoverflow as resources