monkey patching in php
问题 I'm trying to figure out how monkey patching works and how I can make it work on my own objects/methods. I've been looking at this lib, it does exactly what I want to do myself: https://github.com/antecedent/patchwork With it you can redefine a method from an object. It uses the 'monkey patch' technique for that. But I couldn't really figure out what exactly is going on by looking at the source. So suppose I have the following object: //file: MyClass.php namespace MyClass; class MyClass {