Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
In PHP why is using global like in the example below considered bad? $a = 1; class foo { public function bar() { global $a; // <-- Why is this considered bad? } } ...
#1: Initial revision
PHP - Why using "global" considered bad?
In PHP why is using `global` like in the example below [considered bad](https://stackoverflow.com/questions/8488407/php-global-variable-scope-inside-a-class#comment-10502390)? ``` $a = 1; class foo { public function bar() { global $a; // <-- Why is this considered bad? } } ``` I want a concrete example(s) of what can go wrong with this code.