Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy. This forum is not for asking programming related questions.
Technically I believe this is fine (as we all know PHP has a GC built in) and if memory serves me correct won't actually offer a performance increase. I've since forgotten how PHP handles memory.
I don't think memory is released (at least at the OS level) but rather marked as free for later use if required. So long as there wasn't any intensive memory requirements after the above parsing no performance loss should be experienced. In fact calling the function is probably the performance killer if your that anal - which I usually am.
Anyways, the point is, I've used the above (despite making me feel uneasy) and would prefer a single line as opposed to three.
What is your reaction to the above if you seen that code? Would you add the cleanup just cuz it's proper practice?
I tend to shy away from one liners, just because it makes code much less readable. We're not using 640x400 screens anymore, I think we can afford a little more whitespace
It's not really a one liner issue for me or whitespace. It's that three lines are the same (technically) as one and in this case, the one line is just as legible and the three lines, at least to me it is.
However, it was opinion I was after and it is opinion that I got, despite being different from my own
Jenk wrote:My reaction is "What the hell is this thread about?"
Sorry.
Haha
Nothing really...sometimes when I think to much I find myself basically battling myself for what the right or wrong way or best or ideal solution would be, so in cases like these (because I work from my room and no one around me is tech) I turn to a message forum in hopes or getting an opinion and possibly assist me in coming to a conclusion.
My apologies if I've wasted your time - as I see how that could the case (it's not helpful to the community but more me).