Performance of Singleton Class Instance Method vs. Static Class Method in PHP?

前端 未结 5 1489
天涯浪人
天涯浪人 2021-02-06 12:06

I\'m interested in objective analysis of which is more performant; calling instance methods of a singleton class or methods of a static class. I\'ve already seen this so I\'m no

5条回答
  •  日久生厌
    2021-02-06 12:50

    In previous tests that I've done, I've found that calling static methods is faster than calling instance methods, and fractionally more memory efficient.... but the singleton shouldn't be dismissed purely for those reasons.

提交回复
热议问题