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
RunKit extension can do it (runkit_method_add()
, etc.)
However it's an experimental extension and you're already aiming at your foot...
You have other options:
__get()
and __call()
class Plugin extends BaseImplementation
and have factory instantiate Plugin
instead of BaseImplementation
). Zend Plugin Loader does something like this.$this->plugin->onFoo()
). There's library for this.