Hay, when should variables be set within a PHP class?
<?php class MyClass { var $my_var; // here? like var $my_var = null; function __construct(){ $this->my_var = null; // or here? } } ?> It depends what you want to initialise them to. I prefer to initialise them when they're declared if possible, but if they need to be, for example, the result of a method call, then you'll need to initialise them in the constructor.
I'm thinking it would be best to initialize them in the constructor. I would normally think it's a matter of developer preference, but with the introduction of auto-implemented properties with C# 3.0, I think it makes more sense to simply put all intialization in the constructor(s) because you cannot supply a value to a property declared in this manner. And being consistent about where you intialize variables makes your code more readable.