So I want to be able to add/remove class methods at runtime. Before you tell me that\'s horrible pratice in oop, it might be, but I don\'t really care. The reason I want to
You can override the class, but I don't know if you can reload it in the same request. some behavior change can be achieved with mediator design pattern (symfony event dispatcher) but you need to know the extension points in advance, and fire events/messages to be caught by an extending class in the future..
if you can wait for the next request, and clear cache if you have it. I made a tool that might help you. SourceEditor
Here there are more answers to a similar question too, where I put code examples. How to generate or modify a PHP class at runtime?