Re: PHP class class Usage Summary
there are two ways to assign or value properties of classes.
1, using the common domain public keyword.
2, using __set () and __get () to assign and value respectively, the former is called a set method (setter) or a modification method (mutator), and the latter is called the access method (accessor) or the acquisition method (getter). It is recommended to use this method: the advantages are:
A and data validation in __set ().
B, easy to unified management properties.
note:
First: __set () and __get () only play a role in private properties. For attributes defined by public, they are two lazy.
class test{
protected $a=9, $b=2, $c;