|
|
|
|
|
by EugeneOZ
5000 days ago
|
|
"It's a static property because it applies to all object of the class, not an individual object" Why? if you will have 3 databases, each will have same password? "And how is making the property public a bad idea?" Because it's breaks encapsulation. Also, there is two kind of "class" usages in PHP: as Object and as Structure. If your class is just Structure (contain no methods at all), then, of course, public properties is what we need. But when your class is an Object, which should have instances, API, then keep all properties encapsulated. |
|