I'm new to PHP, but one thing that puzzled me is that many people do not recommend the use of global variables in PHP for website development (e.g. Wordpress). People talk about 'polluting' memory and things like that. If using global variables is really that bad, why was it then introduced in the first place?
What are cases when the use of global variables is generally accepted?