Features

1

Does not miss any internal calls:

Patchwork does without namespace tricks, it will also handle calls that are resolved at runtime, like $var() or call_user_func($func), and ones that are made indirectly through internal functions, like array_map('count', $matrix).

2

Accepts wildcards:

redefine('Cache::*', $body) is a perfectly valid operation, and so is redefine('*', $body): just remember that for internal functions, it will only cover those that are listed in patchwork.json.

3

Can redefine the redefinitions again:

A function or method that is already redefined can have arbitrarily many more redefinitions “stacked” on top of the first one, and if you were to call relay(), it would respect the ordering as well.

4

Preserves file names and line numbers:

Even though Patchwork has to modify your code in order to work, it does so in an unobtrusive way. It goes without saying as well that this does not involve altering the original files.

5

Can cache the transformed code files:

Inserting {"cache-path": "any-path-here"} in a patchwork.json will make Patchwork use the directory named any-path-here to store transformed code. This will result in a significant performance boost; however, it will still probably be insufficient for production.