There are two things here: scale and visibility. Both will decide together whether you can access the property.
As you discovered in your first test, late static binding allows $a be available in the scope of the Father class. It just means that the variable (not necessarily its value) is โknownโ to this class.
Visibility determines whether variables in a scope can be accessed by specific classes and instances. Private property is visible only to the class in which it is defined. In the second example, $a is defined as private inside Son . Regardless of whether he knows any other class, he cannot be accessed outside of Son .
static does $a property, which is known as Father , but the visibility of the property decides whether its value can be accessed.
As a test, to help understand it, try using self instead of static . You will get another error, which $a not a Father property.
source share