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 Integrating PHP with Databases Databases and PHP Working with Objects

how can I check the correct answer if my answer was wrong? Thanks!

The code block below includes a third-party library that makes available a simple object that adds two numbers together. (There are better and easier ways to add numbers together in PHP; this is just an example.) The code then creates an object, specifies two numbers, and adds them together. Which of the following is a "method"? include "inc/class.adder.php";

$my_summer = new Adder();

$my_summer->number1 = 2;

$my_summer->number2 = 3;

echo $my_summer->doAdder(); Witch answer is right?

1 Answer

doAdder is the method