Why use PHP OOP over basic functions and when?

后端 未结 10 1924
深忆病人
深忆病人 2020-12-04 13:14

There are some posts about this matter, but I didn\'t clearly get when to use object-oriented coding and when to use programmatic functions in an include. Somebody also ment

10条回答
  •  半阙折子戏
    2020-12-04 13:52

    If you have 50 functions instead of 50 static methods into Utilities class, you "pollute" the global namespace.

    Using a class with 50 static methods, method names are local to your class.

提交回复
热议问题