DEV Community

Discussion on: Global Variables are coming to town

brzuchal profile image
Michał Brzuchalski • Edited on

You shouldn't have written about globals in PHP these were a cool feature 10-15yrs ago now considered bad practice since they bring lot of confusion and may cause lot of problems. Technically the article is ok but it lacks examples of bad uses and consequences coming from its use. The example with PHP embedded into HTML is not something you usually see in the code instead for frontend apps a templating systems which use different than global features used to interpolate variables.

andersbjorkland profile image
Anders Björkland Author

These are a series of short articles, so for brevity's sake I keep it short and in a setting that fast get the point across.

Yes, I'm not a fan of globals myself. But super-globals are still a thing. It's a way to access request variables when not using frameworks.