Are there any consequences to not declaring variables at the start of the class declaration. I mean, I always do it because it is just neater and nicer, but my latest project is huge, and I have added loads of vars without declaration in the heat of the moment without consequence. I am now about to go and add them all to the opening declaration no matter what, just curious.
Share
The PHP parser doesn’t care one way or the another, but, especially because your code base is so huge, having a consistent class layout will help you immensely. It need not be the start, though that is probably the most common place for it.