Answer the question
In order to leave comments, you need to log in
Do the same principles of differences between singleton and stat class work in different languages?
Mastering MVC and patterns
https://habrahabr.ru/post/103681/ - a good article about singleton and static class
There is a table, comparisons of singleton and Static class Are the
given comparisons valid for both C# and PHP or is it not so at all?
ps I didn’t find a good article about the stat class in PHP except this one (phpfaq), but it’s about the approach itself and not about the difference
Answer the question
In order to leave comments, you need to log in
Yes, for all PLs, where there is a singleton and a stat in general.
Actually, singleton should be understood as a crutch. This is a means of preventing the class constructor from reworking.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question