I currently have my PHP class variables set up like this:
class someThing {
private $cat;
private $dog;
private $mouse;
private $hamster;
pr
I prefer the first method, for a few reasons:
In a good IDE, the class properties show up, even if private/protected It's easier to see what has already been defined, reducing the chance you store the same information twice. If the proverbial bus hits you on the way home, it's a lot simpler for another developer to come in and read your code. And while it doesn't apply to private var, it does to protected vars, in classes that extend this class, you really should try to avoid the second method for pure readability.
Also, as a side note, I almost always choose protected over private unless I have a very specific reason to make it private.
The only time I'd probably use the second method was if I was storing a collection of many of one kind of thing.