Now that I have started using a test suite -- this one, in fact -- my life has improved. At least I can see why PHP is not doing what I want it to.
There is something very satisfying about testing as you go. It definitely improves the modularity of your code.