Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP

jough
jough
11,541 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. :(