
Dynamic properties in classes?
by Cameron
I found this blog post on Reddit this morning...
http://www.krisjordan.com/2008/11/27/dynamic-properties-in-php-with-stdc...
... discussing dynamic class properties in PHP. Well, as it turns out, PHP by default just lets you do whatever the hell you want with properties, which seems like a bad idea to me, I've always defined getters and setters to access protected properties, but I do like the idea of defining the __set() magic method to throw an exception, to stop any other devs working on the project from utilizing this "feature" of PHP's.

Post new comment