php - Using Static or Singleton Classes

one text

I am currently trying to learn about MVC pattern and developing a basic project.

From time to time I had to use some classes in many different sections in my project and I wanted to avoid creating static classes for them. While doing research on this subject, I came across the pattern named Singleton and wanted to use it.

Still, I found that Singleton wasn't a very good practice either. I understand why I should avoid using singleton and static classes. But I was wondering (and I've read almost all the questions on Stackoverflow on this topic, yet I haven't found a satisfactory answer) in any project that really doesn't have any Singletons and static classes, is it always better? I currently have 1 static class, and I use it to load other classes, it is a loader class. And this makes my job quite easy.

But when I read about it all the replies give me the vibe that Singleton and static classes are bad and should be avoided to the end. Should I avoid using it even in my loader class or would it be useful to use them in global parts like i18n or loading project libraries? I have probably been one of the thousands to ask this question but I really could not figure it out. Almost all popular PHP frameworks use static classes but many of you guys says "Static classes are evil." and "Singletons are bad.".

Source