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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Alex Hort-Francis](https://secure.gravatar.com/avatar/af6cb1a6ee9faa5cbe1d4366439bca57?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Alex Hort-Francis
12,924 PointsConfusion: setting the `$description` property on `ListingPremium` to `protected`, at 1:30
I think the way this is explained is a bit confusing. Alena talks about how properties with a protected
access visibility on a child class are available to the parent class if there is a method that uses a property of the same name in the parent class, and the parent class declares that property, as protected
.
This makes sense in terms of scoping, but confused me because it sounded like the inheritance was going 'back up the chain', which is not how object-oriented programming works.
Only child classes can inherit from parent classes, not the other way around.
A better way to explain this may be to just delete the $description
property from the ListingPremium
child class, as it doesn't need to be declared in both the parent and child classes.
Have I got this right?