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

Create a method on Fish named getInfo that takes no parameters and returns a string that includes the common_name,

<?php public function getInfo(){ return "Fish Name: ". $this->name; return "Fish Flavor: ". $this->flavor; return "Fish Weight: ". $this->record; } ?>

Talha Khalid
Talha Khalid
10,262 Points

Hey Deandre,

What exactly is the question? By the looks of it, the task only asks to return a string with just the common_name but the code is returning a bunch of different things.

Daryl Peterson
Daryl Peterson
7,812 Points

From what I remember of that exercise the problem is

class Fish doesn't have a variable $name it's common_name

<?php
public function getInfo(){ 

    return "Fish Name: ". $this->common_name; return "Fish Flavor: ". $this->flavor; return "Fish Weight: ". $this->record; 

}
?>

php