Just a question that passed into my head - is the magic __set function supposed to return anything? Currently I don't - and the examples I've always seen don't. I throw an exception when the user tries an illegal set.
| SitePoint Sponsor |

Just a question that passed into my head - is the magic __set function supposed to return anything? Currently I don't - and the examples I've always seen don't. I throw an exception when the user tries an illegal set.




Conceptually speaking it should not return anything (other than $this, if you're into chaining) since it's a 'setter'
Turnware MVC - A new barebone, fast and flexible PHP5 framework!
Ruben Knol
Turnware MVC Lead Developer

Shouldn't the setter return the value you assign, so you can do stuff like
i.e.PHP Code:while ($row = mysqli_fetch_assoc($res)) { ... }
?PHP Code:function __set($name, $value) {
// blah
return $value;
}
Rémon - Hosting Advisor
Minimal Bookmarks Tree
My Google Chrome extension: browsing bookmarks made easy
Bookmarks