One of the most pacifying code-related things I read recently (and now I can’t find the link on Stack-overflow) was a post arguing one shouldn’t worry about organizing or optimizing PHP code for load time or speed much at all.
The coder rightly noted that almost all of the performance gains for page load come from organizing and minimizing frontend static files by minimizing the number of HTTP requests and the size of the resources loaded.
The server you’re running on makes a difference too but now you can usually just find hosts that are pre-optimized for the application you’re developing (laravel, WordPress) so also you needn’t worry much about the server configuration.
Forgetting about tweaking PHP for page load is freeing. This means the only optimization is in, basically, the organization, neatness, maintainability and, as a consequence, “scalability” of your server side code.
Optimizing frontend code is still a nuisance but less so each year with new, better servers and tools to help.
Eventually our move towards higher and higher levels of abstraction and faster servers will hopefully allow us to get even more done in less time and with less waste from worry about “optimization” so we can just focus on building stuff that solves problems. For now, however, it’s nice to know that choices made for PHP organization should be mostly made for readability instead of performance.
And it’s, like everything, important to learn what actually matter and what you really should stop futzing with or worrying about.