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

jough
jough
12,877 Points

Offering a misleading solution - php access modifiers

At 3:10 she changes the title of the 2nd recipe to lower case and then 'demonstrates' how it the access modifier did not capitalize it - she says this is because she "accessed the property directly" and that it needs to be private instead of public. But what she didn't do (until later) is update the object from $recipe2->title to $recipe->setTitle like she did in the first object.

It wasn't changing the property from public to private that changes the case, it was updating the object to use setTitle. setTitle changes the case even if the property is public.

So she's attributing a result to the wrong problem and then offering a solution that makes no difference. Giving solutions for things that aren't actually the cause of the problem makes learning php more confusing than it already is. :(