1
0
mirror of https://github.com/restoreddev/phpapprentice.git synced 2025-08-11 09:14:44 +02:00

Continuing transition to hugo

This commit is contained in:
Andrew Davis
2019-07-13 08:48:55 -05:00
parent e09557cf2c
commit 2ae912aada
36 changed files with 224 additions and 401 deletions

View File

@@ -1,3 +1,11 @@
+++
title = "Classes: Visibility"
description = "Privatizing your objects"
tags = ["php", "private", "protected", "visibility"]
slug = "classes-visibility"
previous = "classes-inheritance.html"
next = "classes-constructor.html"
+++
In the last chapter, we defined properties and methods on the class using the public keyword.
You can also define them using the `protected` and `private` keywords.
Both keywords prevent the properties and functions from being accessible outside the object.