PHP Automatic Properties / Overloading

MV

New Member
I am writing some PHP. I have several classes that do not declare any properties, public or otherwise. I have a custom mySQL class that fetches objects from mySQL and sets property values for the newly init'd PHP object like so...\[code\]while ($row = mysql_fetch_assoc($result)){ foreach($row as $key => $value) { $this->{$key} = $value; }}\[/code\]This seems to work fine as I can then call said properties anywhere I please ... \[code\]$this->my_auto_property\[/code\] etc. I cannot find any PHP docs that describe this as a way to overload a class object's properties. Is this okay? I want to make sure it's not some sort of backwards compatibility that will evaporate in future releases of PHP.
 
Back
Top