I am wondering what is the best way to group my PHP classes. At the moment when I create new class I am adding a lot of require_once "FancyClass.php"; on the top so that I can use already built functionality and I am wondering how can I avoid this.
I read that in PHP 5.3 there are namespaces but there are two reasons that make me think they are not the best solution for me. First of all as far as I understand them to use my FancyClass.php I have to write require again even if I am in the same namespace. The second reason is that I am developing kind of a small framework and I would like to target more PHP versions, at least PHP 5.2+
I have experience with C# and java and they have namespaces and packages which really simplify your work. Does PHP have something similar or any workaround?
write autoload handler and let it to load all classes when they are first used in code. spl_autoload_register