Question: So I have a simple class that contains a property and a method. I don't understand why the private property of my class can be outputted outside of that class. Can anyone make some light on this? I read that it a private property can't be accessed outside of its class.

Why I don't get an error on the next code?

```php
class simpleClass{
    private $property = 'TEST';
        public function show_property(){
          echo $this->property;
        }
}

$my_object = new simpleClass();
$my_object->show_property();

```

Answer: 
Because you're not accessing the property from outside the class at all.

You're calling the `show_property()` method, which is public so you're allowed to call it. `show_property()` in turn is accessing the private property, but that's also OK, since that is *not* an access from outside of the class.

The point of having a private property and a public accessor / getter method is exactly this - you have control over how and whether at all your private property may be accessed.
Your code is doing what you ask. You dont acces the private object $property. Instead you acces the public function show\_property() which resides inside the class simpleClass. So the object $property is still private. because both the function and the object are in the same class, the function can acces the object.

If you would try to echo the object from $my\_object, you would fail to do so because the object is private.