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 Build a Simple PHP Application Wrapping Up The Project Sending The Contact Form Email

Jose Morales-Mendizabal
Jose Morales-Mendizabal
19,175 Points

FYI: PHPMailer methods now begin with a lower case letter.

I was looking at the PHPMailer Library on github (https://github.com/PHPMailer/PHPMailer) and I noticed that in the example they give in their github documentation page, the method names are different. The methods now all begin with a lower-case letter. So for example

$mailer->Send() // is now $mailer->send()
$mailer->AddAddress() // is now $mailer->addAddress()
$mailer->MsgHtml() // is now $mailer->msgHTML() 

// and so on.....

In this video Randy is using version 5.2.1 and now, as of late September 2014, PHPMailer is on version 5.2.9 So I assume they changed the casing of their methods at some point during development. Note that properties of the object however still begin with an uppercase letter.

// still the same

$mailer->Subject = "Something";

Jose,

Just got to this section, and thanks for the FYI. That will definitely help my brain keep the properties and methods just a little more distinct.

aykutzdemir
aykutzdemir
8,655 Points

Thank you very much Jose!

1 Answer

William LaMorie
William LaMorie
11,769 Points

While I couldn't find something one way or another about methods, functions in php are non-case sensitive, so it might follow that methods, which are pretty much just class functions are also not case sensitive:

see more at stack overflow: http://stackoverflow.com/questions/5643496/are-php-functions-case-sensitive