I was experimenting with the access modifiers in Step 17 of Object Oriented PHP for Beginners. I made pinn_number a private property. I used the classes' constructor to set its value. Finally, I created a public function called get_pinn_number().
Outside of the class, I was able to obtain the value of pinn_number using get_pinn_number. I do not understand why this would work. I understand that the value of making properties private is so that their values are available only within the class where they are defined. Therefore, in practice, why would a developer make the value of a private property available through a public function? In practice, would a developer make get_pinn_number() a private function - and not a public one? This documentation is awesome! Thanks so much!