Best practice in PHP to keep instances global or within function scope?

As PHP is request based it does not make a big difference where you inizialize an object, as it is recreated on every request anyway, but using globals is considered bad practice and should not be used in new code IMO.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions