A
A
Alexander Ivanov2017-10-20 15:47:55
PHP
Alexander Ivanov, 2017-10-20 15:47:55

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

2 answer(s)
B
Boris Korobkov, 2017-10-20
@cimonlebedev

Yes, for all PLs, where there is a singleton and a stat in general.

P
Pavel Kornilov, 2017-10-20
@KorniloFF

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 question

Ask a Question

731 491 924 answers to any question