Limitations

1

Internal functions, but not methods:

For example, PDO::prepare is still impossible to redefine in version 2.0. This, however, is a priority item in Patchwork's roadmap.

2

Too slow for production:

Even with the built-in caching mechanism, the boost will be insufficient as of now. If used every n-th request, though, which would make sense for profiling, it would probably not cause any big issues.

3

Only pre-declared internal functions:

Patchwork will fail on every attempt to redefine an internal function that is missing from the redefinable-internals array of your patchwork.json.

4

Magic constants will not expand as expected:

In redefinitions, __FUNCTION__, self::class and other means of self-reference will not work as the “redefinition” metaphor would make one expect to. The latter is just a metaphor; the “new code” is not plugged in anywhere, so the constants will just resolve to their own physical scope. See API for substitutes.

5

Picky about importing:

Make sure that Patchwork is imported as early as possible, since any files imported earlier, including the one from which the importing takes place, will be missed by Patchwork's code preprocessor.