What are disadvantages of putting utility classes only into a namespace in PHP?

Wednesday, November 4, 2015

In a project I defined several utility classes (currently in the global namespace).



Now I thought of moving them as static methods into a utility class. In order to avoid naming conflicts, I could also simply use a namespace.



What are possible reasons to anyway move them into a utility class?



The only thing that came to my mind is, that I can't take advanatage of the classloader, if the methods are not within a class.

0 comments:

Post a Comment