PHP loads classes into memory and never frees them as far as I am aware. This can be problematic when using attributes.
I am wondering whether fibers could be used. How independent is a fiber? Ultimately the question is this: if a PHP fiber loads a class, is that going to be autoloaded for the rest of the PHP code or is it a separate memory space?