I'm writing an app in modular way, so I can possibly reuse some of the components. I've also written utility functions that are shared among different components. For example, if I have classes A (in A.php), B (in B.php), and C (in C.php), and a function f (in utils.php), and this function is used in both A, B, and C, how does one organize the code?
For testing purposes, I run A.php, B.php, and C.php separately, so I need to include utils.php in all of them. Is doing require_once 'utils.php' in all three files a good solution? I've heard there may be a minor performance issue with using require_once. Or should I maybe write a separate 'test.php', whre I would import all the files I need, and use that code for testing instead of writing tests in actual class files?