Accessing a global variable inside nested functions?

Using global is not a bad practice if used properly. This case you would use global and it will be totally fine.

Don't listen anybody, who are speaking about global. Read books about OOP (e.g. This one), read about Dependency Injection, Factory-patterns. Dependency Injection is the best way to create flexible and easy-to-maintain code, and by DI philosophy you will pass $foo from first to third function in arguments, or will pass Context object with all necessary variables (if you want to minimize count of arguments).

More about DI you can read here: http://components.symfony-project.org/dependency-injection/trunk/book/00-Introduction.

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