I have a class in which I use __set. Since I don't want it to set just anything, I have an array of validated variables that it checks before it actually sets the class property.
However, in the constructor, I want the method to __constructset several class properties, some of which are not listed in the approved list. Therefore, when the construction occurs, and I do $this->var = $value, I, of course, get my exception that I am not allowed to set this variable.
Can I get around this somehow?
source
share