Is calling a function in OOP slow or is it the overhead?<>
This question already has an answer here:
- Is object-oriented PHP slow? 10 answers
You are touching the very old debate between making a one large query to get your data, or looping over many smaller ones to receive them. And the answer lies in specifics of implementations. In some cases it is faster to call that one function over and over, while other times it will just kill your performance. The "overhead" from just calling a function over and over is pretty minimal, it's the "guts" of it that matter.